forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev(CI): Enable playwright test retry
- Loading branch information
Showing
1 changed file
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
import { PlaywrightTestConfig } from '@playwright/test' | ||
import { PlaywrightTestConfig } from "@playwright/test"; | ||
|
||
const config: PlaywrightTestConfig = { | ||
// The directory where the tests are located | ||
// The order of the tests is determined by the file names alphabetically. | ||
testDir: './e2e-tests', | ||
testDir: "./e2e-tests", | ||
|
||
// The number of retries before marking a test as failed. | ||
maxFailures: 1, | ||
|
||
// retry on failure for CI | ||
retries: process.env.CI ? 2 : 0, | ||
|
||
// The number of Logseq instances to run in parallel. | ||
// NOTE: must be 1 for now, otherwise tests will fail. | ||
workers: 1, | ||
|
||
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'. | ||
// default 'list' when running locally. | ||
reporter: process.env.CI ? 'github' : 'list', | ||
reporter: process.env.CI ? "github" : "list", | ||
|
||
// Fail the build on CI if test.only is present. | ||
forbidOnly: !!process.env.CI, | ||
|
||
use: { | ||
// SCapture screenshot after each test failure. | ||
screenshot: 'only-on-failure', | ||
screenshot: "only-on-failure", | ||
}, | ||
} | ||
}; | ||
|
||
export default config | ||
export default config; |