graphql-engine/frontend/apps/console-ce-e2e/cypress.config.ts
Nicolas Beaussart f3951e1680 frontend: update nx to latest 15
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8079
Co-authored-by: Stefano Magni <173663+NoriSte@users.noreply.github.com>
GitOrigin-RevId: 46b1ed03ab225fccc9d769203d1af11a6bcdb63e
2023-02-28 19:42:51 +00:00

55 lines
1.2 KiB
TypeScript

import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { initPlugin as initSnapshotPlugin } from 'cypress-plugin-snapshots/plugin';
import * as customTasks from './src/support/tasks';
type ConfigOptions = Parameters<typeof defineConfig>[0];
const nxConfig = nxE2EPreset(__filename);
interface MyConfigOptions extends ConfigOptions {
useRelativeSnapshots?: boolean;
}
const myDefineConfig = (config: MyConfigOptions) => defineConfig(config);
export default myDefineConfig({
viewportWidth: 1440,
viewportHeight: 900,
chromeWebSecurity: false,
numTestsKeptInMemory: 10,
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',
e2e: {
...nxConfig,
video: false,
specPattern: [
'src/e2e/**/*test.{js,jsx,ts,tsx}',
'src/support/**/*unit.test.{js,ts}',
],
setupNodeEvents(on, config) {
on('task', {
...customTasks,
});
initSnapshotPlugin(on, config);
return config;
},
},
useRelativeSnapshots: true,
});