Skip to content

Commit 8583e6d

Browse files
committed
ci: playwright.config.ts honors PLAYWRIGHT_PROJECTS env filter
1 parent 33340b1 commit 8583e6d

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

playwright.config.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
import { defineConfig, devices } from '@playwright/test';
22

3+
const ALL_PROJECTS = [
4+
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
5+
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
6+
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
7+
];
8+
9+
// PLAYWRIGHT_PROJECTS=chromium,firefox limits the matrix. Empty or unset
10+
// runs every project. Local dev sets chromium, release.yml installs all.
11+
const requested = process.env.PLAYWRIGHT_PROJECTS?.split(',')
12+
.map((s) => s.trim())
13+
.filter(Boolean);
14+
15+
const projects = requested?.length
16+
? ALL_PROJECTS.filter((p) => requested.includes(p.name))
17+
: ALL_PROJECTS;
18+
319
export default defineConfig({
420
testDir: './packages/ui/tests/e2e',
521
fullyParallel: true,
@@ -17,18 +33,5 @@ export default defineConfig({
1733
reuseExistingServer: !process.env.CI,
1834
timeout: 30_000,
1935
},
20-
projects: [
21-
{
22-
name: 'chromium',
23-
use: { ...devices['Desktop Chrome'] },
24-
},
25-
{
26-
name: 'firefox',
27-
use: { ...devices['Desktop Firefox'] },
28-
},
29-
{
30-
name: 'webkit',
31-
use: { ...devices['Desktop Safari'] },
32-
},
33-
],
36+
projects,
3437
});

0 commit comments

Comments
 (0)