2021-06-10 16:09:38 +03:00
|
|
|
import { PlaywrightTestConfig } from "@playwright/test"
|
|
|
|
|
|
|
|
import path from "path"
|
|
|
|
|
2021-10-28 23:27:17 +03:00
|
|
|
// The default configuration runs all tests in three browsers with workers equal
|
2024-10-18 07:31:28 +03:00
|
|
|
// to half the available threads. See 'npm run test:e2e --help' to customize
|
|
|
|
// from the command line. For example:
|
|
|
|
// npm run test:e2e --workers 1 # Run with one worker
|
|
|
|
// npm run test:e2e --project Chromium # Only run on Chromium
|
|
|
|
// npm run test:e2e --grep login # Run tests matching "login"
|
|
|
|
// PWDEBUG=1 npm run test:e2e # Run Playwright inspector
|
2021-06-10 16:09:38 +03:00
|
|
|
const config: PlaywrightTestConfig = {
|
|
|
|
testDir: path.join(__dirname, "e2e"), // Search for tests in this directory.
|
|
|
|
timeout: 60000, // Each test is given 60 seconds.
|
2021-06-23 00:34:44 +03:00
|
|
|
retries: process.env.CI ? 2 : 1, // Retry in CI due to flakiness.
|
2022-08-09 21:24:37 +03:00
|
|
|
// Limit the number of failures on CI to save resources
|
|
|
|
maxFailures: process.env.CI ? 3 : undefined,
|
2021-12-17 22:06:52 +03:00
|
|
|
globalSetup: require.resolve("./utils/globalE2eSetup.ts"),
|
2021-06-10 16:09:38 +03:00
|
|
|
reporter: "list",
|
|
|
|
// Put any shared options on the top level.
|
|
|
|
use: {
|
|
|
|
headless: true, // Run tests in headless browsers.
|
2021-06-24 23:08:41 +03:00
|
|
|
video: "retain-on-failure",
|
2021-06-10 16:09:38 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
projects: [
|
|
|
|
{
|
|
|
|
name: "Chromium",
|
|
|
|
use: { browserName: "chromium" },
|
|
|
|
},
|
2024-09-19 13:10:46 +03:00
|
|
|
// Firefox seems to have bugs with opening context menus in the file tree.
|
|
|
|
// {
|
|
|
|
// name: "Firefox",
|
|
|
|
// use: { browserName: "firefox" },
|
|
|
|
// },
|
2021-06-10 16:09:38 +03:00
|
|
|
{
|
|
|
|
name: "WebKit",
|
|
|
|
use: { browserName: "webkit" },
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
export default config
|