Skip to content

Commit f6087f5

Browse files
authored
chore: provide better config defaults (#84)
1 parent 71488ca commit f6087f5

File tree

2 files changed

+10
-36
lines changed

2 files changed

+10
-36
lines changed

assets/playwright.config.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ const { defineConfig, devices } = require('@playwright/test');
1212
*/
1313
module.exports = defineConfig({
1414
testDir: './{{testDir}}',
15-
/* Maximum time one test can run for. */
16-
timeout: 30 * 1000,
17-
expect: {
18-
/**
19-
* Maximum time expect() should wait for the condition to be met.
20-
* For example in `await expect(locator).toHaveText();`
21-
*/
22-
timeout: 5000
23-
},
2415
/* Run tests in files in parallel */
2516
fullyParallel: true,
2617
/* Fail the build on CI if you accidentally left test.only in the source code. */
@@ -33,10 +24,8 @@ module.exports = defineConfig({
3324
reporter: 'html',
3425
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
3526
use: {
36-
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
37-
actionTimeout: 0,
3827
/* Base URL to use in actions like `await page.goto('/')`. */
39-
// baseURL: 'http://localhost:3000',
28+
// baseURL: 'http://127.0.0.1:3000',
4029

4130
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
4231
trace: 'on-first-retry',
@@ -78,21 +67,19 @@ module.exports = defineConfig({
7867
/* Test against branded browsers. */
7968
// {
8069
// name: 'Microsoft Edge',
81-
// use: { channel: 'msedge' },
70+
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
8271
// },
8372
// {
8473
// name: 'Google Chrome',
85-
// use: { channel: 'chrome' },
74+
// use: { ..devices['Desktop Chrome'], channel: 'chrome' },
8675
// },
8776
],
8877

89-
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
90-
// outputDir: 'test-results/',
91-
9278
/* Run your local dev server before starting the tests */
9379
// webServer: {
9480
// command: 'npm run start',
95-
// port: 3000,
81+
// url: 'http://127.0.0.1:3000',
82+
// reuseExistingServer: !process.env.CI,
9683
// },
9784
});
9885

assets/playwright.config.ts

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ import { defineConfig, devices } from '@playwright/test';
1111
*/
1212
export default defineConfig({
1313
testDir: './{{testDir}}',
14-
/* Maximum time one test can run for. */
15-
timeout: 30 * 1000,
16-
expect: {
17-
/**
18-
* Maximum time expect() should wait for the condition to be met.
19-
* For example in `await expect(locator).toHaveText();`
20-
*/
21-
timeout: 5000
22-
},
2314
/* Run tests in files in parallel */
2415
fullyParallel: true,
2516
/* Fail the build on CI if you accidentally left test.only in the source code. */
@@ -32,10 +23,8 @@ export default defineConfig({
3223
reporter: 'html',
3324
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
3425
use: {
35-
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
36-
actionTimeout: 0,
3726
/* Base URL to use in actions like `await page.goto('/')`. */
38-
// baseURL: 'http://localhost:3000',
27+
// baseURL: 'http://127.0.0.1:3000',
3928

4029
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
4130
trace: 'on-first-retry',
@@ -77,20 +66,18 @@ export default defineConfig({
7766
/* Test against branded browsers. */
7867
// {
7968
// name: 'Microsoft Edge',
80-
// use: { channel: 'msedge' },
69+
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
8170
// },
8271
// {
8372
// name: 'Google Chrome',
84-
// use: { channel: 'chrome' },
73+
// use: { ..devices['Desktop Chrome'], channel: 'chrome' },
8574
// },
8675
],
8776

88-
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
89-
// outputDir: 'test-results/',
90-
9177
/* Run your local dev server before starting the tests */
9278
// webServer: {
9379
// command: 'npm run start',
94-
// port: 3000,
80+
// url: 'http://127.0.0.1:3000',
81+
// reuseExistingServer: !process.env.CI,
9582
// },
9683
});

0 commit comments

Comments
 (0)