Skip to content

Commit 251080b

Browse files
chore: [nx migration] 17-3-1-add-project-to-config
1 parent 2571726 commit 251080b

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

apps/demo-e2e/playwright.config.ts

+19-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
import { defineConfig } from '@playwright/test';
1+
import { defineConfig, devices } from '@playwright/test';
22
import { nxE2EPreset } from '@nx/playwright/preset';
3-
43
import { workspaceRoot } from '@nx/devkit';
5-
64
// For CI, you may want to set BASE_URL to the deployed application.
75
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
8-
96
/**
107
* Read environment variables from file.
118
* https://github.com/motdotla/dotenv
129
*/
1310
// require('dotenv').config();
14-
1511
/**
1612
* See https://playwright.dev/docs/test-configuration.
1713
*/
18-
export default defineConfig({
19-
...nxE2EPreset(__filename, { testDir: './src' }),
20-
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
21-
use: {
22-
baseURL,
23-
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
24-
trace: 'on-first-retry',
25-
},
26-
/* Run your local dev server before starting the tests */
27-
webServer: {
28-
command: 'npx nx serve demo',
29-
url: 'http://localhost:4200',
30-
reuseExistingServer: !process.env.CI,
31-
cwd: workspaceRoot,
32-
},
33-
});
14+
export default defineConfig({ ...nxE2EPreset(__filename, { testDir: './src' }),
15+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
16+
use: {
17+
baseURL,
18+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
19+
trace: 'on-first-retry',
20+
},
21+
/* Run your local dev server before starting the tests */
22+
webServer: {
23+
command: 'npx nx serve demo',
24+
url: 'http://localhost:4200',
25+
reuseExistingServer: !process.env.CI,
26+
cwd: workspaceRoot,
27+
}, projects: [
28+
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
29+
{ name: "firefox", use: { ...devices["Desktop Firefox"] } },
30+
{ name: "webkit", use: { ...devices["Desktop Safari"] } }
31+
] });

0 commit comments

Comments
 (0)