forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
42 lines (37 loc) · 1.14 KB
/
Copy pathplaywright.config.ts
File metadata and controls
42 lines (37 loc) · 1.14 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
41
42
import defaultConfig from '@microsoft/fast-test-harness/playwright.config.mjs';
import { defineConfig, devices } from '@playwright/test';
const CI = process.env.CI === 'true';
// Duplicate each browser project across CSR and SSR rendering modes so a
// single `playwright test` run exercises both. Per-test overrides
// (e.g. `test.use({ ssr: true })`) still take precedence over the
// project-level value.
//
// TODO: Remove this local axis once the equivalent change lands in
// @microsoft/fast-test-harness/playwright.config.mjs.
const browsers = [
{ name: 'chromium', use: devices['Desktop Chrome'] },
{ name: 'firefox', use: devices['Desktop Firefox'] },
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
deviceScaleFactor: 1,
},
},
];
const modes = [
{ suffix: 'csr', ssr: false },
{ suffix: 'ssr', ssr: true },
];
const projects = browsers.flatMap(browser =>
modes.map(mode => ({
name: `${browser.name}-${mode.suffix}`,
use: { ...browser.use, ssr: mode.ssr },
})),
);
export default defineConfig({
...defaultConfig,
projects,
reporter: CI ? 'github' : 'list',
testMatch: 'src/**/*.spec.ts',
});