mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-01 21:05:42 +09:00
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
import { defineConfig } from "@playwright/test";
|
|
import {
|
|
browserContextOptions,
|
|
builderUrl,
|
|
getBrowserLaunchOptions,
|
|
} from "./e2e/test";
|
|
import { getE2eTestMatch } from "./e2e/test-shards";
|
|
|
|
const testTimeout =
|
|
Number.parseInt(process.env.E2E_TEST_TIMEOUT_MS ?? "", 10) || 120_000;
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
outputDir: "./test-results/e2e",
|
|
timeout: testTimeout,
|
|
expect: { timeout: 10_000 },
|
|
fullyParallel: false,
|
|
forbidOnly: process.env.CI !== undefined,
|
|
retries: 0,
|
|
reporter: process.env.CI
|
|
? [["line"], ["html", { open: "never" }], ["./e2e/timing-reporter.ts"]]
|
|
: "line",
|
|
use: {
|
|
...browserContextOptions,
|
|
actionTimeout: 20_000,
|
|
navigationTimeout: 45_000,
|
|
launchOptions: getBrowserLaunchOptions(),
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
video: "retain-on-failure",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "setup",
|
|
testMatch: /setup\.ts/,
|
|
},
|
|
{
|
|
name: "chromium",
|
|
testMatch: getE2eTestMatch(process.env.E2E_TEST_SHARD),
|
|
dependencies: ["setup"],
|
|
use: { browserName: "chromium" },
|
|
},
|
|
],
|
|
webServer:
|
|
process.env.E2E_BUILDER_URL === undefined
|
|
? {
|
|
// The server loads prebuilt JavaScript bundles. Use Node's type
|
|
// stripping for the launcher when available.
|
|
command: process.features.typescript
|
|
? "node --enable-source-maps --conditions=webstudio ./e2e/serve-built-remix.ts"
|
|
: "pnpm exec tsx --conditions=webstudio ./e2e/serve-built-remix.ts",
|
|
url: builderUrl,
|
|
reuseExistingServer: false,
|
|
ignoreHTTPSErrors: true,
|
|
timeout: 120_000,
|
|
stdout: "pipe",
|
|
stderr: "pipe",
|
|
}
|
|
: undefined,
|
|
});
|