Skip to content

Commit 4c12d03

Browse files
committed
dev(CI): Enable playwright test retry
1 parent 98b1a99 commit 4c12d03

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

playwright.config.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1-
import { PlaywrightTestConfig } from '@playwright/test'
1+
import { PlaywrightTestConfig } from "@playwright/test";
22

33
const config: PlaywrightTestConfig = {
44
// The directory where the tests are located
55
// The order of the tests is determined by the file names alphabetically.
6-
testDir: './e2e-tests',
6+
testDir: "./e2e-tests",
77

88
// The number of retries before marking a test as failed.
99
maxFailures: 1,
1010

11+
// retry on failure for CI
12+
retries: process.env.CI ? 2 : 0,
13+
1114
// The number of Logseq instances to run in parallel.
1215
// NOTE: must be 1 for now, otherwise tests will fail.
1316
workers: 1,
1417

1518
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'.
1619
// default 'list' when running locally.
17-
reporter: process.env.CI ? 'github' : 'list',
20+
reporter: process.env.CI ? "github" : "list",
1821

1922
// Fail the build on CI if test.only is present.
2023
forbidOnly: !!process.env.CI,
2124

2225
use: {
2326
// SCapture screenshot after each test failure.
24-
screenshot: 'only-on-failure',
27+
screenshot: "only-on-failure",
2528
},
26-
}
29+
};
2730

28-
export default config
31+
export default config;

0 commit comments

Comments
 (0)