2022-11-24 20:32:00 +03:00
|
|
|
const fetch = require('node-fetch');
|
2022-11-22 16:11:29 +03:00
|
|
|
const { defineConfig } = require('cypress');
|
2022-11-08 15:21:10 +03:00
|
|
|
|
2022-11-24 20:32:00 +03:00
|
|
|
const BASE_URL = 'http://localhost:5678';
|
|
|
|
|
2022-11-08 15:21:10 +03:00
|
|
|
module.exports = defineConfig({
|
2022-12-09 12:10:55 +03:00
|
|
|
retries: {
|
|
|
|
openMode: 1,
|
2022-12-15 18:39:59 +03:00
|
|
|
runMode: 3,
|
2022-12-09 12:10:55 +03:00
|
|
|
},
|
2022-11-08 15:21:10 +03:00
|
|
|
e2e: {
|
2022-11-24 20:32:00 +03:00
|
|
|
baseUrl: BASE_URL,
|
2022-11-08 15:21:10 +03:00
|
|
|
video: false,
|
2022-11-22 12:37:26 +03:00
|
|
|
screenshotOnRunFailure: true,
|
2022-11-08 15:21:10 +03:00
|
|
|
experimentalSessionAndOrigin: true,
|
|
|
|
experimentalInteractiveRunEvents: true,
|
2022-11-24 20:32:00 +03:00
|
|
|
|
2022-11-28 20:11:33 +03:00
|
|
|
setupNodeEvents(on, config) {
|
2022-11-24 20:32:00 +03:00
|
|
|
on('task', {
|
2022-12-15 18:39:59 +03:00
|
|
|
reset: () => fetch(BASE_URL + '/e2e/db/reset', { method: 'POST' }),
|
2022-11-28 20:11:33 +03:00
|
|
|
'setup-owner': (payload) =>
|
2022-11-24 20:32:00 +03:00
|
|
|
fetch(BASE_URL + '/e2e/db/setup-owner', {
|
|
|
|
method: 'POST',
|
|
|
|
body: JSON.stringify(payload),
|
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
},
|
2022-11-22 16:11:29 +03:00
|
|
|
},
|
2022-11-08 15:21:10 +03:00
|
|
|
});
|