forked from Sage/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
65 lines (59 loc) · 1.49 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
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
63
64
65
const { defineConfig } = require("cypress");
const webpackConfig = require("./cypress/webpack.config.js");
async function setupNodeEvents(on, config) {
on("task", {
log(message) {
console.log(message);
return null;
},
table(message) {
console.table(message);
return null;
},
});
on("before:browser:launch", (browser = {}, launchOptions) => {
if (browser.family === "chromium" && browser.name !== "electron") {
launchOptions.args.push("--disable-site-isolation-trials");
launchOptions.args.push("--disable-gpu"); // disable update for chrome for CI
launchOptions.args.push(
`--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'`
);
}
return launchOptions;
});
return config;
}
module.exports = defineConfig({
blockHosts: ["www.google-analytics.com", "sockjs*", "countries*"],
env: {
TAGS: "not @ignore",
iframe: "iframe.html?id=",
},
failOnStatusCode: false,
video: false,
viewportWidth: 1366,
viewportHeight: 768,
chromeWebSecurity: false,
projectId: "8458bb",
retries: {
runMode: 1,
openMode: 1,
},
e2e: {
setupNodeEvents,
baseUrl: "http://127.0.0.1:9001/",
specPattern: "./cypress/e2e/**/*.test.js",
},
component: {
devServer: {
framework: "react",
bundler: "webpack",
webpackConfig,
},
watchForFileChanges: true,
specPattern: [
"./src/components/**/*.test.js",
"./cypress/componentTheme/themes.test.js",
],
},
});