forked from playwrightsolutions/playwright-api-test-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
56 lines (51 loc) · 1.41 KB
/
playwright.config.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
import { defineConfig } from "@playwright/test";
import { config } from "dotenv";
import Env from "@helpers/env";
/* This allows you to pass in a `test_env` environment variable
to specify which environment you want to run the tests against */
if (process.env.test_env) {
config({
path: `.env.${process.env.test_env}`,
override: true,
});
} else {
config();
}
if (!process.env.CURRENTS_CI_BUILD_ID) {
process.env.CURRENTS_CI_BUILD_ID = "butch-local-" + new Date().getTime();
}
export default defineConfig({
// Keeping this section commented out due to using storage state will make all api calls succeed (even the negative test scenarios)
// projects: [
// { name: "setup", testMatch: /.*\.setup\.ts/ },
// {
// name: "api-checks",
// use: {
// storageState: ".auth/admin.json",
// },
// dependencies: ["setup"],
// },
// ],
testDir: "tests",
projects: [
{ name: "setup", testMatch: /coverage.setup.ts/, teardown: "teardown" },
{
name: "api-checks",
dependencies: ["setup"],
},
{
name: "teardown",
testMatch: /completion.teardown.ts/,
},
],
use: {
extraHTTPHeaders: {
"playwright-solutions": "true",
},
baseURL: Env.URL,
ignoreHTTPSErrors: true,
trace: "on",
},
retries: 2,
reporter: process.env.CI ? [["github"], ["list"], ["html"], ["@currents/playwright"]] : [["list"], ["html"]],
});