-
Notifications
You must be signed in to change notification settings - Fork 1
/
playwright.config.reporter.ts
62 lines (53 loc) · 1.7 KB
/
playwright.config.reporter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { CurrentsConfig, CurrentsFixtures, currentsReporter, CurrentsWorkerFixtures } from "@currents/playwright";
import { defineConfig, devices } from "@playwright/test";
/**
* Currents configuration
*
* This needs to be passed to both
* - the Currents reporter
* - and the fixtures `currentsConfigOptions` property
*
* (see "report" and "use" sections below)
*/
const currentsConfig: CurrentsConfig = {
recordKey: process.env.CURRENTS_RECORD_KEY || "", // 📖 https://currents.dev/readme/guides/record-key
projectId: process.env.CURRENTS_PROJECT_ID || "", // get one at https://app.currents.dev
};
export default defineConfig<CurrentsFixtures, CurrentsWorkerFixtures>({
timeout: 10 * 1000,
fullyParallel: true,
expect: {
timeout: 5000,
},
reporter: process.env.CURRENTS_PROJECT_ID ? [currentsReporter(currentsConfig)] : undefined, // 👈🏻 add Currents reporter when Currents project ID is present
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
use: {
actionTimeout: 0,
trace: "on",
video: "on",
screenshot: "on",
currentsConfigOptions: currentsConfig, // 👈🏻 add Currents configuration for fixtures
// We can disable Currents fixtures if Currents project ID is missing
currentsFixturesEnabled: !!process.env.CURRENTS_PROJECT_ID,
},
projects: [
{
name: "Project A",
retries: 2,
use: {
...devices["Desktop Chrome"],
},
},
{
name: "Project B",
retries: 2,
use: {
...devices["Desktop Chrome"],
},
},
],
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
outputDir: "test-results/",
});