2022-08-05 21:52:47 +03:00
|
|
|
import { defineConfig } from 'cypress';
|
|
|
|
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
|
2023-02-07 17:06:48 +03:00
|
|
|
import { initPlugin as initSnapshotPlugin } from 'cypress-plugin-snapshots/plugin';
|
2022-08-05 21:52:47 +03:00
|
|
|
|
2022-08-31 12:03:22 +03:00
|
|
|
import * as customTasks from './src/support/tasks';
|
|
|
|
|
2023-02-05 09:52:32 +03:00
|
|
|
type ConfigOptions = Parameters<typeof defineConfig>[0];
|
|
|
|
|
2023-02-28 22:41:18 +03:00
|
|
|
const nxConfig = nxE2EPreset(__filename);
|
2022-08-31 12:03:22 +03:00
|
|
|
|
2023-02-05 09:52:32 +03:00
|
|
|
interface MyConfigOptions extends ConfigOptions {
|
|
|
|
useRelativeSnapshots?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
const myDefineConfig = (config: MyConfigOptions) => defineConfig(config);
|
|
|
|
export default myDefineConfig({
|
|
|
|
viewportWidth: 1440,
|
|
|
|
viewportHeight: 900,
|
|
|
|
|
2022-08-31 12:03:22 +03:00
|
|
|
chromeWebSecurity: false,
|
|
|
|
numTestsKeptInMemory: 10,
|
2023-02-05 09:52:32 +03:00
|
|
|
|
|
|
|
retries: {
|
|
|
|
openMode: 0,
|
|
|
|
// Allows for one automatic retry per test
|
|
|
|
// see: https://docs.cypress.io/guides/guides/test-retries#How-It-Works
|
|
|
|
runMode: 1,
|
|
|
|
},
|
|
|
|
|
|
|
|
projectId: '5yiuic',
|
|
|
|
|
2022-08-31 12:03:22 +03:00
|
|
|
e2e: {
|
|
|
|
...nxConfig,
|
|
|
|
|
2023-02-05 09:52:32 +03:00
|
|
|
video: false,
|
2023-02-07 19:14:44 +03:00
|
|
|
|
2023-02-05 09:52:32 +03:00
|
|
|
specPattern: [
|
|
|
|
'src/e2e/**/*test.{js,jsx,ts,tsx}',
|
|
|
|
'src/support/**/*unit.test.{js,ts}',
|
|
|
|
],
|
|
|
|
|
2022-08-31 12:03:22 +03:00
|
|
|
setupNodeEvents(on, config) {
|
|
|
|
on('task', {
|
|
|
|
...customTasks,
|
|
|
|
});
|
|
|
|
|
2023-02-07 17:06:48 +03:00
|
|
|
initSnapshotPlugin(on, config);
|
|
|
|
|
2022-08-31 12:03:22 +03:00
|
|
|
return config;
|
|
|
|
},
|
|
|
|
},
|
2023-02-05 09:52:32 +03:00
|
|
|
|
|
|
|
useRelativeSnapshots: true,
|
2022-08-05 21:52:47 +03:00
|
|
|
});
|