forked from saleor/saleor-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
51 lines (50 loc) · 1.45 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
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-console */
const { defineConfig } = require("cypress");
const fs = require("fs");
const cypressSplit = require("cypress-split");
module.exports = defineConfig({
projectId: "51ef7c",
chromeWebSecurity: false,
defaultCommandTimeout: 20000,
requestTimeout: 20000,
viewportWidth: 1400,
viewportHeight: 660,
screenshotsFolder: "cypress/reports/mochareports",
screenshotOnRunFailure: true,
experimentalMemoryManagement: true,
numTestsKeptInMemory: 8,
retries: {
runMode: 2,
openMode: 0,
},
reporter: "cypress-multi-reporters",
reporterOptions: {
configFile: "reporter-config.json",
},
e2e: {
env: {
grepFilterSpecs: true,
grepOmitFiltered: true,
},
baseUrl: process.env.BASE_URL,
async setupNodeEvents(on, config) {
config = require("./cypress/support/cypress-grep/plugin")(config);
config = await require("./cypress/plugins/index.js")(on, config);
cypressSplit(on, config);
on("after:spec", (spec, results) => {
if (results && results.video) {
return fs.unlink(results.video, function (err) {
if (err) {
console.warn(`Could not remove video - ${err}`);
} else {
console.log("File removed:", results.video);
}
});
}
});
return config;
},
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
},
});