Skip to content

Commit a802055

Browse files
committed
test(server): fix extension e2e test error from serviceworker timeout
1 parent d2de3a7 commit a802055

2 files changed

Lines changed: 25 additions & 57 deletions

File tree

apps/extension/playwright.config.ts

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ export default defineConfig({
1515
// Retry on CI only.
1616
retries: process.env.CI ? 1 : 0,
1717

18-
// Opt out of parallel tests on CI.
19-
workers: process.env.CI ? 1 : undefined,
18+
workers: process.env.CI ? 2 : undefined,
19+
fullyParallel: true,
2020

21-
// Increase global timeout to 3 minutes (waitForEvent is 120s)
2221
timeout: 180000,
2322

24-
// Reporter to use
2523
reporter: [
2624
cucumberReporter('html', {
2725
outputFile: 'cucumber-report/index.html',
@@ -31,27 +29,23 @@ export default defineConfig({
3129
],
3230

3331
use: {
34-
// Collect trace when retrying the failed test.
35-
trace: { mode: "retain-on-first-failure" },
36-
screenshot: { mode: 'on' },
37-
// Enable video recording for debugging
32+
trace: { mode: 'retain-on-first-failure' },
33+
screenshot: { mode: 'only-on-failure' },
3834
video: 'retain-on-failure',
39-
// Enable detailed logging
40-
launchOptions: {
41-
args: ['--enable-logging', '--v=1'],
42-
},
35+
...(process.env.CI || process.env.DEBUG
36+
? { launchOptions: { args: ['--enable-logging', '--v=1'] } }
37+
: {}),
4338
},
4439

45-
// Configure projects for major browsers.
4640
projects: [
4741
{
48-
name: "chromium",
49-
//channel: "chromium" -> https://github.com/microsoft/playwright/issues/33682
50-
use: { ...devices["Desktop Chrome"], channel: "chromium" },
42+
name: 'chromium',
43+
// https://github.com/microsoft/playwright/issues/33682
44+
use: { ...devices['Desktop Chrome'], channel: 'chromium' },
5145
},
5246
{
5347
name: 'Microsoft Edge',
5448
use: { ...devices['Desktop Edge'], channel: 'msedge' },
5549
},
5650
],
57-
});
51+
});

apps/server-ui-e2e/playwright.config.ts

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,36 @@ import { defineConfig, devices } from '@playwright/test';
22
import { nxE2EPreset } from '@nx/playwright/preset';
33
import { workspaceRoot } from '@nx/devkit';
44

5-
// For CI, you may want to set BASE_URL to the deployed application.
65
const baseURL = process.env['BASE_URL'] || 'http://localhost:4300';
76

8-
/**
9-
* Read environment variables from file.
10-
* https://github.com/motdotla/dotenv
11-
*/
12-
// require('dotenv').config();
13-
14-
/**
15-
* See https://playwright.dev/docs/test-configuration.
16-
*/
177
export default defineConfig({
188
...nxE2EPreset(__filename, { testDir: './src' }),
19-
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
9+
retries: process.env.CI ? 1 : 0,
10+
fullyParallel: !process.env.CI,
11+
2012
use: {
2113
baseURL,
22-
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
2314
trace: 'on-first-retry',
2415
},
25-
/* Run your local dev server before starting the tests */
26-
webServer: {
27-
command: 'pnpm exec nx run server-ui:preview',
28-
url: 'http://localhost:4300',
29-
reuseExistingServer: !process.env.CI,
30-
cwd: workspaceRoot,
31-
},
32-
projects: [
3316

17+
webServer: [
3418
{
35-
name: "chromium",
36-
//channel: "chromium" -> https://github.com/microsoft/playwright/issues/33682
37-
use: { ...devices["Desktop Chrome"], channel: "chromium" },
19+
command: 'pnpm exec nx run server-ui:preview',
20+
url: 'http://localhost:4300',
21+
reuseExistingServer: !process.env.CI,
22+
cwd: workspaceRoot,
3823
},
24+
],
25+
26+
projects: [
3927
{
40-
name: 'Microsoft Edge',
41-
use: { ...devices['Desktop Edge'], channel: 'msedge' },
42-
},
43-
// Uncomment for mobile browsers support
44-
/* {
45-
name: 'Mobile Chrome',
46-
use: { ...devices['Pixel 5'] },
28+
name: 'chromium',
29+
// https://github.com/microsoft/playwright/issues/33682
30+
use: { ...devices['Desktop Chrome'], channel: 'chromium' },
4731
},
4832
{
49-
name: 'Mobile Safari',
50-
use: { ...devices['iPhone 12'] },
51-
}, */
52-
53-
// Uncomment for branded browsers
54-
/* {
5533
name: 'Microsoft Edge',
5634
use: { ...devices['Desktop Edge'], channel: 'msedge' },
5735
},
58-
{
59-
name: 'Google Chrome',
60-
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
61-
} */
6236
],
6337
});

0 commit comments

Comments
 (0)