1.6 KB45 lines
Blame
1import eyesPlugin from '@applitools/eyes-cypress';
2import { registerArgosTask } from '@argos-ci/cypress/task';
3import coverage from '@cypress/code-coverage/task.js';
4import { defineConfig } from 'cypress';
5import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin.js';
6import cypressSplit from 'cypress-split';
7import 'dotenv/config';
8
9export default eyesPlugin(
10 defineConfig({
11 projectId: 'n2sma2',
12 viewportWidth: 1440,
13 viewportHeight: 1024,
14 e2e: {
15 baseUrl: `http://localhost:${process.env.MERMAID_PORT ?? 9000}`,
16 specPattern: 'cypress/integration/**/*.{js,ts}',
17 setupNodeEvents(on, config) {
18 coverage(on, config);
19 cypressSplit(on, config);
20 on('before:browser:launch', (browser, launchOptions) => {
21 if (browser.name === 'chrome' && browser.isHeadless) {
22 launchOptions.args.push('--window-size=1440,1024', '--force-device-scale-factor=1');
23 }
24 return launchOptions;
25 });
26 // copy any needed variables from process.env to config.env
27 config.env.useAppli = process.env.USE_APPLI ? true : false;
28 config.env.useArgos = process.env.RUN_VISUAL_TEST === 'true';
29
30 if (config.env.useArgos) {
31 registerArgosTask(on, config, {
32 // Enable upload to Argos only when it runs on CI.
33 uploadToArgos: !!process.env.CI,
34 });
35 } else {
36 addMatchImageSnapshotPlugin(on, config);
37 }
38 // do not forget to return the changed config object!
39 return config;
40 },
41 },
42 video: false,
43 })
44);
45