Remove videos of successful runs

This commit is contained in:
Sebastian Sdorra
2020-08-26 08:48:43 +02:00
parent 06ecfd786e
commit 2f7ff72fd1
3 changed files with 28 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
{ {
"baseUrl": "http://localhost:8081/scm" "baseUrl": "http://localhost:8081/scm",
"videoUploadOnPasses": false
} }

View File

@@ -8,10 +8,12 @@
"private": false, "private": false,
"scripts": { "scripts": {
"headless": "cypress run", "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": { "devDependencies": {
"cypress": "^4.12.0",
"eslint-plugin-cypress": "^2.11.1" "eslint-plugin-cypress": "^2.11.1"
}, },
"prettier": "@scm-manager/prettier-config", "prettier": "@scm-manager/prettier-config",

View File

@@ -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));