-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcypress.config.js
36 lines (34 loc) · 1.27 KB
/
cypress.config.js
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
import { defineConfig } from "cypress";
import dotenv from "dotenv";
import htmlvalidate from "cypress-html-validate/plugin";
import { downloadAllUrlsToValidate } from "./cypress/support/before";
dotenv.config();
module.exports = defineConfig({
defaultCommandTimeout: 20000, // 20s
e2e: {
baseUrl: process.env.TEST_BASEURL ?? "http://localhost:3000",
specPattern:
process.env.TEST_MODE === "heavy"
? "cypress/integration/heavy/**/*.spec.{js,jsx,ts,tsx}"
: process.env.TEST_MODE === "light"
? "cypress/integration/light/**/*.spec.{js,jsx,ts,tsx}"
: process.env.TEST_MODE === "html-validation"
? "cypress/integration/html-validation/**/*.spec.{js,jsx,ts,tsx}"
: process.env.TEST_MODE === "heavy-and-light"
? "cypress/integration/{light,heavy}/**/*.spec.{js,jsx,ts,tsx}"
: "cypress/integration/**/*.spec.{js,jsx,ts,tsx}",
supportFile: "cypress/support/index.ts",
viewportHeight: 1000,
viewportWidth: 1280,
chromeWebSecurity: false,
setupNodeEvents(on) {
htmlvalidate.install(on);
on("before:run", async () => {
if (process.env.TEST_MODE === "html-validation") {
await downloadAllUrlsToValidate();
}
});
},
},
video: false,
});