Skip to content

Commit

Permalink
chore: cypress config
Browse files Browse the repository at this point in the history
  • Loading branch information
rboixaderg committed Dec 17, 2023
1 parent a52b203 commit 46871fd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions e2e/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
const { defineConfig } = require('cypress')
const fs = require('fs')

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
return config
on('after:spec', (spec, results) => {
if (results && 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) {
// delete the video if the spec passed and no tests retried
fs.unlinkSync(results.video)
}
}
})
},
baseUrl: 'http://localhost:4173/?path=',
videoUploadOnPasses: false,
video: true,
experimentalFetchPolyfill: true,
chromeWebSecurity: false,
env: {
Expand Down

0 comments on commit 46871fd

Please sign in to comment.