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
This commit is contained in:
committed by
GitHub
parent
aec08275aa
commit
e409813ea9
@@ -1,11 +1,26 @@
|
||||
const fetch = require('node-fetch');
|
||||
const { defineConfig } = require('cypress');
|
||||
|
||||
const BASE_URL = 'http://localhost:5678';
|
||||
|
||||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
baseUrl: 'http://localhost:5678',
|
||||
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' },
|
||||
}),
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user