Skip to content

Commit c7a9b2f

Browse files
committed
Add playwright config
1 parent 8046d92 commit c7a9b2f

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

playwright.config.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { defineConfig, devices } from "@playwright/test";
2+
3+
/**
4+
* Read environment variables from file.
5+
* https://github.com/motdotla/dotenv
6+
*/
7+
// require('dotenv').config();
8+
9+
/**
10+
* See https://playwright.dev/docs/test-configuration.
11+
*/
12+
export default defineConfig({
13+
testDir: "./e2e",
14+
outputDir: "./playwright/test-results",
15+
/* Run tests in files in parallel */
16+
fullyParallel: true,
17+
/* Fail the build on CI if you accidentally left test.only in the source code. */
18+
// forbidOnly: !!process.env.CI,
19+
/* Retry on CI only */
20+
retries: 0,
21+
/* Opt out of parallel tests on CI. */
22+
// workers: process.env.CI ? 1 : undefined,
23+
workers: 1,
24+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
25+
reporter: [["html", { outputFolder: "./playwright/report" }]],
26+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
27+
use: {
28+
/* Base URL to use in actions like `await page.goto('/')`. */
29+
baseURL: "http://127.0.0.1:8000",
30+
31+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
32+
trace: "on-first-retry",
33+
},
34+
35+
/* Configure projects for major browsers */
36+
projects: [
37+
{
38+
name: "chromium",
39+
use: { ...devices["Desktop Chrome"] },
40+
},
41+
42+
// {
43+
// name: 'firefox',
44+
// use: { ...devices['Desktop Firefox'] },
45+
// },
46+
//
47+
// {
48+
// name: 'webkit',
49+
// use: { ...devices['Desktop Safari'] },
50+
// },
51+
],
52+
});

0 commit comments

Comments
 (0)