generate screenshots

This commit is contained in:
SPRINX0\prochazka
2025-01-30 08:07:27 +01:00
parent 9309f25126
commit 93dc48c22c
8 changed files with 75 additions and 10 deletions

View File

@@ -3,11 +3,13 @@ const killPort = require('kill-port');
const { clearTestingData } = require('./e2eTestTools');
const waitOn = require('wait-on');
const { exec } = require('child_process');
const fs = require('fs');
const path = require('path');
module.exports = defineConfig({
e2e: {
trashAssetsBeforeRuns: false,
// trashAssetsBeforeRuns: false,
setupNodeEvents(on, config) {
// implement node event listeners here
@@ -41,6 +43,15 @@ module.exports = defineConfig({
});
}
});
on('after:screenshot', details => {
fs.renameSync(details.path, path.resolve(__dirname, `screenshots/${details.name}.png`));
});
// on('task', {
// renameFile({ from, to }) {
// fs.renameSync(from, to);
// },
// });
},
},
});