diff --git a/test/config.ts b/test/config.ts new file mode 100644 index 0000000000000000000000000000000000000000..60339b41d36d7822b25deb13fa5810112120367d --- /dev/null +++ b/test/config.ts @@ -0,0 +1,16 @@ +import { ChromiumEnv, FirefoxEnv, WebKitEnv, test, setConfig, PlaywrightOptions } from "@playwright/test" + +setConfig({ + testDir: "e2e", // Search for tests in this directory. + timeout: 30000, // Each test is given 30 seconds. +}) + +const options: PlaywrightOptions = { + headless: true, // Run tests in headless browsers. + video: "retain-on-failure", +} + +// Run tests in three browsers. +test.runWith(new ChromiumEnv(options), { tag: "chromium" }) +test.runWith(new FirefoxEnv(options), { tag: "firefox" }) +test.runWith(new WebKitEnv(options), { tag: "webkit" }) diff --git a/test/jest.e2e.config.ts b/test/jest.e2e.config.ts deleted file mode 100644 index 666534419d24aabef52042346d4f586c27cc60fb..0000000000000000000000000000000000000000 --- a/test/jest.e2e.config.ts +++ /dev/null @@ -1,39 +0,0 @@ -// jest.config.ts -import type { Config } from "@jest/types" - -const config: Config.InitialOptions = { - preset: "jest-playwright-preset", - transform: { - "^.+\\.ts$": "/node_modules/ts-jest", - }, - globalSetup: "/utils/globalSetup.ts", - testEnvironmentOptions: { - "jest-playwright": { - // TODO(@jsjoeio) enable on webkit and firefox - // waiting on next playwright release - // - https://github.com/microsoft/playwright/issues/6009#event-4536210890 - // - https://github.com/microsoft/playwright/issues/6020 - browsers: ["chromium"], - // If there's a page error, we don't exit - // i.e. something logged in the console - exitOnPageError: false, - contextOptions: { - recordVideo: { - dir: "./test/e2e/videos", - }, - }, - }, - }, - testPathIgnorePatterns: ["/node_modules/", "/lib/", "/out/", "test/unit"], - testTimeout: 30000, - modulePathIgnorePatterns: [ - "/../lib/vscode", - "/../release-packages", - "/../release", - "/../release-standalone", - "/../release-npm-package", - "/../release-gcp", - "/../release-images", - ], -} -export default config diff --git a/test/package.json b/test/package.json index e222c1e5954805d43d2924fa1d4217df93177be6..747f72f0476a0378d602a00f6b4eb392fede22fa 100644 --- a/test/package.json +++ b/test/package.json @@ -2,7 +2,7 @@ "license": "MIT", "#": "We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha.", "devDependencies": { - "@playwright/test": "^0.1101.0", + "@playwright/test": "^0.1101.0-alpha2", "@types/jest": "^26.0.20", "@types/jsdom": "^16.2.6", "@types/node-fetch": "^2.5.8", diff --git a/test/yarn.lock b/test/yarn.lock index 8aae7ad999137cf37ce85ff59ed61ed0af763958..ffeda36af5b5b735af01872fff7829ccd922f50c 100644 --- a/test/yarn.lock +++ b/test/yarn.lock @@ -1258,10 +1258,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@playwright/test@^0.1101.0": - version "0.1101.0" - resolved "https://registry.yarnpkg.com/@playwright/test/-/test-0.1101.0.tgz#73f1195a9fd0c23b4efeff8cd2cd760f94247789" - integrity sha512-yn/psASZhjKKCOJi9oW/5ImZx9wjlXhKvGVtleOC10XxhV0wshBf3eL+40G9o5VjJ8KwJaujj+mFadBrHjEs5w== +"@playwright/test@^0.1101.0-alpha2": + version "0.1101.0-alpha2" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-0.1101.0-alpha2.tgz#a1121ac70e6ac986532ea63c6f565f06fae99364" + integrity sha512-DDJQCTn5iLR2J5T/Fl+BhR9V7G++Y6HmSBLgn3blRZ8HWsJRseD6nowuhUij51rhDiLdJJLVmF4/sVJCqtPGMQ== dependencies: folio "=0.3.23-alpha" playwright "=1.10.0"