mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Fix applitools
This commit is contained in:
parent
ba46747cb0
commit
31e19a0434
@ -1,19 +0,0 @@
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const { defineConfig } = require('cypress');
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
|
||||||
testConcurrency: 1,
|
|
||||||
browser: [
|
|
||||||
// Add browsers with different viewports
|
|
||||||
// { width: 800, height: 600, name: 'chrome' },
|
|
||||||
// { width: 700, height: 500, name: 'firefox' },
|
|
||||||
// { width: 1600, height: 1200, name: 'ie11' },
|
|
||||||
// { width: 1024, height: 768, name: 'edgechromium' },
|
|
||||||
// { width: 800, height: 600, name: 'safari' },
|
|
||||||
// // Add mobile emulation devices in Portrait mode
|
|
||||||
// { deviceName: 'iPhone X', screenOrientation: 'portrait' },
|
|
||||||
// { deviceName: 'Pixel 2', screenOrientation: 'portrait' },
|
|
||||||
],
|
|
||||||
// set batch name to the configuration
|
|
||||||
// batchName: `Mermaid ${process.env.APPLI_BRANCH ?? "'no APPLI_BRANCH set'"}`,
|
|
||||||
});
|
|
@ -1,32 +0,0 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
||||||
|
|
||||||
const { defineConfig } = require('cypress');
|
|
||||||
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
|
|
||||||
const coverage = require('@cypress/code-coverage/task');
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
|
||||||
projectId: 'n2sma2',
|
|
||||||
viewportWidth: 1440,
|
|
||||||
viewportHeight: 1024,
|
|
||||||
e2e: {
|
|
||||||
specPattern: 'cypress/integration/**/*.{js,ts}',
|
|
||||||
setupNodeEvents(on, config) {
|
|
||||||
coverage(on, config);
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
addMatchImageSnapshotPlugin(on, config);
|
|
||||||
// copy any needed variables from process.env to config.env
|
|
||||||
config.env.useAppli = process.env.USE_APPLI ? true : false;
|
|
||||||
|
|
||||||
// do not forget to return the changed config object!
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
video: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
require('@applitools/eyes-cypress')(module);
|
|
30
cypress.config.ts
Normal file
30
cypress.config.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { defineConfig } from 'cypress';
|
||||||
|
import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin';
|
||||||
|
import coverage from '@cypress/code-coverage/task';
|
||||||
|
import eyesPlugin from '@applitools/eyes-cypress';
|
||||||
|
export default eyesPlugin(
|
||||||
|
defineConfig({
|
||||||
|
projectId: 'n2sma2',
|
||||||
|
viewportWidth: 1440,
|
||||||
|
viewportHeight: 1024,
|
||||||
|
e2e: {
|
||||||
|
specPattern: 'cypress/integration/**/*.{js,ts}',
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
coverage(on, config);
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
addMatchImageSnapshotPlugin(on, config);
|
||||||
|
// copy any needed variables from process.env to config.env
|
||||||
|
config.env.useAppli = process.env.USE_APPLI ? true : false;
|
||||||
|
|
||||||
|
// do not forget to return the changed config object!
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
video: false,
|
||||||
|
})
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user