-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
40 lines (38 loc) · 1.21 KB
/
playwright.config.ts
File metadata and controls
40 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { defineConfig, devices } from "@playwright/test";
const LANGUAGES = ["en", "de", "fr", "ru"] as const;
const COLOR_SCHEMES = ["dark"] as const;
/**
* @see https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
fullyParallel: true,
retries: 1,
workers: 3,
timeout: 10_000,
reporter: [["list"], ["html"]],
use: {
trace: "on-first-retry",
screenshot: "only-on-failure",
},
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.02,
pathTemplate: "{testDir}/screenshots{/projectName}/{testFilePath}/{testName}{ext}",
},
},
projects: [
...LANGUAGES.map((locale) =>
COLOR_SCHEMES.map((colorScheme) => ({
name: `Chrome popup | ${colorScheme}/${locale}`,
use: { ...devices["Desktop Chrome"], viewport: { width: 320, height: 548 }, colorScheme, locale, timezoneId: "Europe/Berlin" },
}))
).flat(),
...LANGUAGES.map((locale) =>
COLOR_SCHEMES.map((colorScheme) => ({
name: `Chrome fullscreen | ${colorScheme}/${locale}`,
use: { ...devices["Desktop Chrome"], viewport: { width: 1280, height: 720 }, colorScheme, locale, timezoneId: "Europe/Berlin" },
}))
).flat(),
],
});