diff --git a/scm-ui/e2e-tests/cypress.json b/scm-ui/e2e-tests/cypress.json index 03e8546581..fc4d8586ac 100644 --- a/scm-ui/e2e-tests/cypress.json +++ b/scm-ui/e2e-tests/cypress.json @@ -1,3 +1,4 @@ { - "baseUrl": "http://localhost:8081/scm" + "baseUrl": "http://localhost:8081/scm", + "videoUploadOnPasses": false } diff --git a/scm-ui/e2e-tests/package.json b/scm-ui/e2e-tests/package.json index f4b6898bc9..b2214d9496 100644 --- a/scm-ui/e2e-tests/package.json +++ b/scm-ui/e2e-tests/package.json @@ -8,10 +8,12 @@ "private": false, "scripts": { "headless": "cypress run", - "ci": "cypress run --reporter junit --reporter-options \"mochaFile=../target/cypress-reports/TEST-[hash].xml\"" + "ci": "node src/index.js" + }, + "dependencies": { + "cypress": "^4.12.0" }, "devDependencies": { - "cypress": "^4.12.0", "eslint-plugin-cypress": "^2.11.1" }, "prettier": "@scm-manager/prettier-config", diff --git a/scm-ui/e2e-tests/src/index.js b/scm-ui/e2e-tests/src/index.js new file mode 100644 index 0000000000..a7650f549f --- /dev/null +++ b/scm-ui/e2e-tests/src/index.js @@ -0,0 +1,22 @@ +const cypress = require("cypress"); +const fs = require("fs"); +const path = require("path"); + +const options = { + reporter: "junit", + reporterOptions: { + mochaFile: path.join("..", "target", "cypress-reports", "TEST-[hash].xml") + } +}; + +cypress + .run(options) + .then(results => { + results.runs.forEach(run => { + // remove videos of successful runs + if (!run.shouldUploadVideo) { + fs.unlinkSync(run.video); + } + }); + }) + .catch(err => console.error(err));