diff --git a/alfa-client/apps/alfa-e2e/src/support/cypress-tasks.ts b/alfa-client/apps/alfa-e2e/src/support/cypress-tasks.ts index a82b4f736601daf7f1b3164cbb45818a609e29de..827b7b3d31d21f7c991796b5256302ae28354466 100644 --- a/alfa-client/apps/alfa-e2e/src/support/cypress-tasks.ts +++ b/alfa-client/apps/alfa-e2e/src/support/cypress-tasks.ts @@ -67,6 +67,13 @@ module.exports = (on: any, config: any) => { }, }); + on('after:spec', (spec: Cypress.Spec, results: CypressCommandLine.RunResult) => { + if (results && results.video && results.stats.failures === 0) { + console.log(`Delete recorded video because spec passed: ${results.video}`); + fs.unlinkSync(results.video); + } + }); + // Workaround für Angular 13 und Cypress mit Webpack 4, // Siehe https://github.com/cypress-io/cypress/issues/19066#issuecomment-1012055705 // Entfernen, sobald Cypress Webpack 5 nutzt - https://github.com/cypress-io/cypress/issues/19555