forked from ManageIQ/manageiq-ui-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
28 lines (27 loc) · 893 Bytes
/
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
/* eslint-disable no-undef */
const { defineConfig } = require('cypress');
const fs = require('fs');
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
viewportHeight: 800,
viewportWidth: 1800,
numTestsKeptInMemory: 0,
videoCompression: false,
// eslint-disable-next-line no-unused-vars
setupNodeEvents(on, config) {
on('after:spec', (spec, results) => {
// Delete the video on CI if the spec passed and no tests retried
if (process.env.CI && results && results.video && fs.existsSync(results.video)) {
// Do we have failures for any retry attempts?
const failures = results.tests.some((test) =>
test.attempts.some((attempt) => attempt.state === 'failed')
);
if (!failures) {
fs.unlinkSync(results.video);
}
}
});
},
},
});