Skip to content

Commit 405514a

Browse files
committed
front: optimize Playwright execution locally and on CI
Auto-scale workers on CI and limit workers locally Record traces/videos only on failures to reduce overhead Signed-off-by: Maymanaf <med.aymen.naf@gmail.com>
1 parent 6742fd1 commit 405514a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

front/playwright.config.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@ export default defineConfig({
1111
},
1212

1313
fullyParallel: true,
14-
workers: '50%',
15-
forbidOnly: !!process.env.CI,
16-
retries: 1,
14+
workers: isCI ? undefined : '30%',
15+
forbidOnly: isCI,
16+
retries: isCI ? 1 : 0,
1717
use: {
1818
navigationTimeout: isCI ? 30_000 : 60_000,
1919
actionTimeout: 10_000,
2020
baseURL: process.env.BASE_URL || 'http://localhost:4000',
21-
trace: 'retain-on-failure',
22-
video: 'retain-on-failure',
2321
locale: 'fr',
2422
timezoneId: 'Europe/Paris',
2523
viewport: { width: 1920, height: 1080 },
24+
25+
screenshot: 'on-first-failure',
26+
trace: 'retain-on-first-failure',
27+
video: 'on-first-retry',
2628
},
2729
reporter: [
2830
[
@@ -33,7 +35,7 @@ export default defineConfig({
3335
},
3436
],
3537
['line'],
36-
['html'],
38+
['html', { open: isCI ? 'never' : 'on-failure' }],
3739
],
3840

3941
projects: [

0 commit comments

Comments
 (0)