forked from frappe/frappe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
40 lines (38 loc) · 1.14 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
const { defineConfig } = require("cypress");
const fs = require("fs");
module.exports = defineConfig({
projectId: "92odwv",
adminPassword: "admin",
testUser: "[email protected]",
defaultCommandTimeout: 20000,
pageLoadTimeout: 15000,
video: true,
viewportHeight: 960,
viewportWidth: 1400,
retries: {
runMode: 2,
openMode: 2,
},
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
// Delete videos for specs without failing or retried tests
// https://docs.cypress.io/guides/guides/screenshots-and-videos#Delete-videos-for-specs-without-failing-or-retried-tests
on("after:spec", (spec, results) => {
if (results && results.video) {
const failures = results.tests.some((test) =>
test.attempts.some((attempt) => attempt.state === "failed")
);
if (!failures) {
fs.unlinkSync(results.video);
}
}
});
return require("./cypress/plugins/index.js")(on, config);
},
testIsolation: false,
baseUrl: "http://test_site_ui:8000",
specPattern: ["./cypress/integration/*.js", "**/ui_test_*.js"],
},
});