2024-01-23 20:28:11 +05:30
|
|
|
import eyesPlugin from '@applitools/eyes-cypress';
|
2024-06-17 11:31:43 +02:00
|
|
|
import { registerArgosTask } from '@argos-ci/cypress/task';
|
2024-10-04 01:54:36 +05:30
|
|
|
import coverage from '@cypress/code-coverage/task';
|
|
|
|
import { defineConfig } from 'cypress';
|
|
|
|
import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin';
|
|
|
|
import cypressSplit from 'cypress-split';
|
2024-06-17 11:31:43 +02:00
|
|
|
|
2024-01-23 20:28:11 +05:30
|
|
|
export default eyesPlugin(
|
|
|
|
defineConfig({
|
|
|
|
projectId: 'n2sma2',
|
|
|
|
viewportWidth: 1440,
|
|
|
|
viewportHeight: 1024,
|
|
|
|
e2e: {
|
|
|
|
specPattern: 'cypress/integration/**/*.{js,ts}',
|
|
|
|
setupNodeEvents(on, config) {
|
|
|
|
coverage(on, config);
|
2024-10-04 01:54:36 +05:30
|
|
|
cypressSplit(on, config);
|
2024-01-23 20:28:11 +05:30
|
|
|
on('before:browser:launch', (browser, launchOptions) => {
|
|
|
|
if (browser.name === 'chrome' && browser.isHeadless) {
|
|
|
|
launchOptions.args.push('--window-size=1440,1024', '--force-device-scale-factor=1');
|
|
|
|
}
|
|
|
|
return launchOptions;
|
|
|
|
});
|
|
|
|
// copy any needed variables from process.env to config.env
|
|
|
|
config.env.useAppli = process.env.USE_APPLI ? true : false;
|
2024-06-20 18:26:19 +05:30
|
|
|
config.env.useArgos = !!process.env.CI;
|
2024-01-23 20:28:11 +05:30
|
|
|
|
2024-06-20 15:11:38 +05:30
|
|
|
if (config.env.useArgos) {
|
|
|
|
registerArgosTask(on, config, {
|
2024-06-20 18:26:19 +05:30
|
|
|
token: 'fc3a35cf5200db928d65b2047861582d9444032b',
|
2024-06-20 15:11:38 +05:30
|
|
|
});
|
|
|
|
} else {
|
|
|
|
addMatchImageSnapshotPlugin(on, config);
|
|
|
|
}
|
2024-01-23 20:28:11 +05:30
|
|
|
// do not forget to return the changed config object!
|
|
|
|
return config;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
video: false,
|
|
|
|
})
|
|
|
|
);
|