Skip to content

Commit 537a466

Browse files
committed
update config
1 parent dd55953 commit 537a466

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

playwright.config.ts

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

33
/**
44
* Read environment variables from file.
@@ -12,7 +12,7 @@ import { defineConfig, devices } from '@playwright/test';
1212
* See https://playwright.dev/docs/test-configuration.
1313
*/
1414
export default defineConfig({
15-
testDir: './tests',
15+
testDir: "./tests",
1616
/* Run tests in files in parallel */
1717
fullyParallel: true,
1818
/* Fail the build on CI if you accidentally left test.only in the source code. */
@@ -22,31 +22,31 @@ export default defineConfig({
2222
/* Opt out of parallel tests on CI. */
2323
workers: process.env.CI ? 1 : undefined,
2424
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
25-
reporter: 'html',
25+
reporter: "html",
2626
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2727
use: {
2828
/* Base URL to use in actions like `await page.goto('/')`. */
2929
// baseURL: 'http://127.0.0.1:3000',
3030

3131
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
32-
trace: 'on-first-retry',
32+
trace: "on-first-retry",
3333
},
3434

3535
/* Configure projects for major browsers */
3636
projects: [
3737
{
38-
name: 'chromium',
39-
use: { ...devices['Desktop Chrome'] },
38+
name: "chromium",
39+
use: { ...devices["Desktop Chrome"] },
4040
},
4141

4242
{
43-
name: 'firefox',
44-
use: { ...devices['Desktop Firefox'] },
43+
name: "firefox",
44+
use: { ...devices["Desktop Firefox"] },
4545
},
4646

4747
{
48-
name: 'webkit',
49-
use: { ...devices['Desktop Safari'] },
48+
name: "webkit",
49+
use: { ...devices["Desktop Safari"] },
5050
},
5151

5252
/* Test against mobile viewports. */
@@ -76,4 +76,11 @@ export default defineConfig({
7676
// url: 'http://127.0.0.1:3000',
7777
// reuseExistingServer: !process.env.CI,
7878
// },
79+
80+
webServer: {
81+
command: "npm run start", // Start the Next.js server
82+
url: "http://localhost:3000", // Ensure this matches your app's URL
83+
timeout: 300000, // Wait up to 2 minutes for the server to be ready
84+
reuseExistingServer: !process.env.CI, // Avoid restarting locally
85+
},
7986
});

0 commit comments

Comments
 (0)