n8n/cypress.config.js
कारतोफ्फेलस्क्रिप्ट™ e409813ea9
ci: Setup cypress tasks for resetting DB, and setting up an owner (#4717)
* ci: Setup cypress tasks for resetting DB, and setting up an owner

* address Ivan's comments
2022-11-24 18:32:00 +01:00

27 lines
658 B
JavaScript

const fetch = require('node-fetch');
const { defineConfig } = require('cypress');
const BASE_URL = 'http://localhost:5678';
module.exports = defineConfig({
e2e: {
baseUrl: BASE_URL,
video: false,
screenshotOnRunFailure: true,
experimentalSessionAndOrigin: true,
experimentalInteractiveRunEvents: true,
setupNodeEvents(on) {
on('task', {
'db:reset': () => fetch(BASE_URL + '/e2e/db/reset', { method: 'POST' }),
'db:setup-owner': (payload) =>
fetch(BASE_URL + '/e2e/db/setup-owner', {
method: 'POST',
body: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' },
}),
});
},
},
});