-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcypress.config.ts
50 lines (48 loc) · 1.14 KB
/
cypress.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
import { defineConfig } from "cypress";
import * as util from "util";
import * as path from "path";
const exec = util.promisify(require("child_process").exec);
const runCommand = (cmd, failOnError = true) => {
console.log(cmd);
return exec(cmd)
.then((stdout, stderr) => {
console.log(stdout);
return 0;
})
.catch((err) => {
if (failOnError) {
throw err;
} else {
console.log(err);
return 0;
}
});
};
export default defineConfig({
e2e: {
baseUrl: "http://localhost:9000",
setupNodeEvents(on, config) {
on("task", {
deleteAllNHCs() {
return runCommand(`oc delete NodeHealthCheck --all`);
},
apply(fixture) {
return runCommand(
`oc apply -f ${path.join(
__dirname,
"cypress",
"fixtures",
fixture
)}`
);
},
deleteNodeHealthCheck(name) {
return runCommand(`oc delete NodeHealthCheck ${name}`, false);
},
});
},
},
viewportHeight: 1080,
viewportWidth: 1920,
defaultCommandTimeout: 10000,
});