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({
|
2023-03-02 07:50:21 -08:00
|
|
|
projectId: "5hbsdn",
|
2022-12-09 01:10:55 -08:00
|
|
|
retries: {
|
2023-02-07 08:51:11 -08:00
|
|
|
openMode: 0,
|
2023-03-02 07:50:21 -08:00
|
|
|
runMode: 2,
|
2022-12-09 01:10:55 -08:00
|
|
|
},
|
2023-03-02 07:50:21 -08:00
|
|
|
defaultCommandTimeout: 10000,
|
|
|
|
requestTimeout: 12000,
|
2023-05-03 05:06:06 -07:00
|
|
|
numTestsKeptInMemory: 2,
|
2023-03-24 08:12:26 -07:00
|
|
|
experimentalMemoryManagement: true,
|
2022-11-08 04:21:10 -08:00
|
|
|
e2e: {
|
2022-11-24 09:32:00 -08:00
|
|
|
baseUrl: BASE_URL,
|
2023-03-02 07:50:21 -08:00
|
|
|
video: true,
|
2022-11-22 01:37:26 -08:00
|
|
|
screenshotOnRunFailure: true,
|
2022-11-08 04:21:10 -08:00
|
|
|
experimentalInteractiveRunEvents: true,
|
2023-03-02 07:50:21 -08:00
|
|
|
experimentalSessionAndOrigin: 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' }),
|
2023-03-02 07:50:21 -08:00
|
|
|
'setup-owner': (payload) => {
|
|
|
|
try {
|
|
|
|
return fetch(BASE_URL + '/e2e/db/setup-owner', {
|
|
|
|
method: 'POST',
|
|
|
|
body: JSON.stringify(payload),
|
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
|
})
|
|
|
|
} catch (error) {
|
|
|
|
console.error("setup-owner failed with: ", error)
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
},
|
2023-05-03 05:06:06 -07:00
|
|
|
'set-feature': ({ feature, enabled }) => {
|
|
|
|
return fetch(BASE_URL + `/e2e/feature/${feature}`, {
|
|
|
|
method: 'PATCH',
|
|
|
|
body: JSON.stringify({ enabled }),
|
|
|
|
headers: { 'Content-Type': 'application/json' }
|
|
|
|
})
|
|
|
|
},
|
2022-11-24 09:32:00 -08:00
|
|
|
});
|
|
|
|
},
|
2022-11-22 05:11:29 -08:00
|
|
|
},
|
2022-11-08 04:21:10 -08:00
|
|
|
});
|
2023-03-02 07:50:21 -08:00
|
|
|
|