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