Remove vidoes after cypress tests (#2729)
* remove video if test passed, decrease video compression * do not compress videos * always remove videos
This commit is contained in:
parent
e06d3bdf0d
commit
7bcc6dac00
1 changed files with 13 additions and 1 deletions
|
@ -1,10 +1,11 @@
|
||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
|
/* eslint-disable no-console */
|
||||||
const { defineConfig } = require("cypress");
|
const { defineConfig } = require("cypress");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
projectId: "51ef7c",
|
projectId: "51ef7c",
|
||||||
chromeWebSecurity: false,
|
chromeWebSecurity: false,
|
||||||
videoUploadOnPasses: false,
|
|
||||||
defaultCommandTimeout: 20000,
|
defaultCommandTimeout: 20000,
|
||||||
requestTimeout: 20000,
|
requestTimeout: 20000,
|
||||||
viewportWidth: 1400,
|
viewportWidth: 1400,
|
||||||
|
@ -20,6 +21,17 @@ module.exports = defineConfig({
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
config = require("./cypress/support/cypress-grep/plugin")(config);
|
config = require("./cypress/support/cypress-grep/plugin")(config);
|
||||||
config = require("./cypress/plugins/index.js")(on, config);
|
config = require("./cypress/plugins/index.js")(on, config);
|
||||||
|
on("after:spec", (spec, results) => {
|
||||||
|
if (results && results.video) {
|
||||||
|
return fs.unlink(results.video, function(err) {
|
||||||
|
if (err) {
|
||||||
|
console.warn(`Could not remove video - ${err}`);
|
||||||
|
} else {
|
||||||
|
console.log("File removed:", results.video);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
baseUrl: "http://localhost:9000/",
|
baseUrl: "http://localhost:9000/",
|
||||||
|
|
Loading…
Reference in a new issue