test fixes

This commit is contained in:
SPRINX0\prochazka
2024-12-09 16:52:02 +01:00
parent 5405b9bf72
commit 7f367a1f84
9 changed files with 23 additions and 29 deletions

View File

@@ -1,34 +1,14 @@
const { defineConfig } = require('cypress');
const { clearDataWithBackup } = require('./e2eTestTools');
const { exec } = require('child_process');
const waitOn = require('wait-on');
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
let serverProcess;
on('before:spec', async details => {
console.log('******** BEFORE RUN ****************');
clearDataWithBackup();
serverProcess = exec('yarn start');
await waitOn({ resources: ['http://localhost:3000'] });
serverProcess.stdout.on('data', data => {
console.log(data.toString());
});
serverProcess.stderr.on('data', data => {
console.error(data.toString());
});
});
on('after:spec', () => {
console.log('******** AFTER RUN ****************', serverProcess);
if (serverProcess) {
console.log('Stopping local server...');
serverProcess.kill();
}
// await axios.default.post('http://localhost:3000/connections/reload-connection-list', {});
});
},
},

View File

@@ -4,6 +4,7 @@
"main": "index.js",
"license": "GPL",
"devDependencies": {
"axios": "^1.7.9",
"cross-env": "^7.0.3",
"cypress": "^13.16.1",
"start-server-and-test": "^2.0.8"
@@ -12,7 +13,7 @@
"cy:open": "cypress open --config experimentalInteractiveRunEvents=true",
"cy:run": "cypress run",
"cy:run:ci": "cross-env CI=true cypress run",
"start": "cd .. && node packer/build/bundle.js --listen-api --run-packer-build",
"start": "cd .. && node packer/build/bundle.js --listen-api --run-e2e-tests",
"test:ci": "start-server-and-test start http://localhost:3000 cy:run:ci",
"test": "start-server-and-test start http://localhost:3000 cy:run"
}

View File

@@ -176,7 +176,7 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.13.2.tgz#0aa167216965ac9474ccfa83892cfb6b3e1e52ef"
integrity sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==
axios@^1.7.7:
axios@^1.7.7, axios@^1.7.9:
version "1.7.9"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a"
integrity sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==