未验证 提交 08cd2d81 编写于 作者: J Joe Previte

refactor: add new e2e config

上级 0a090bf1
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" })
// jest.config.ts
import type { Config } from "@jest/types"
const config: Config.InitialOptions = {
preset: "jest-playwright-preset",
transform: {
"^.+\\.ts$": "<rootDir>/node_modules/ts-jest",
},
globalSetup: "<rootDir>/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: [
"<rootDir>/../lib/vscode",
"<rootDir>/../release-packages",
"<rootDir>/../release",
"<rootDir>/../release-standalone",
"<rootDir>/../release-npm-package",
"<rootDir>/../release-gcp",
"<rootDir>/../release-images",
],
}
export default config
......@@ -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",
......
......@@ -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"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册