2024-02-06 20:31:38 +03:00
|
|
|
import { defineConfig } from 'cypress'
|
|
|
|
import cypressSplit from 'cypress-split'
|
|
|
|
import { configureVisualRegression } from 'cypress-visual-regression/dist/plugin.js'
|
2024-05-14 12:36:56 +03:00
|
|
|
import vitePreprocessor from 'cypress-vite'
|
|
|
|
import vue from '@vitejs/plugin-vue2'
|
2024-02-06 20:31:38 +03:00
|
|
|
|
|
|
|
export default defineConfig({
|
2022-06-08 15:02:09 +03:00
|
|
|
projectId: 'hx9gqy',
|
|
|
|
viewportWidth: 1280,
|
|
|
|
viewportHeight: 900,
|
2023-11-29 17:47:18 +03:00
|
|
|
screenshotsFolder: './cypress/snapshots/actual',
|
|
|
|
trashAssetsBeforeRuns: true,
|
|
|
|
env: {
|
|
|
|
failSilently: false,
|
|
|
|
type: 'actual',
|
|
|
|
SNAPSHOT_BASE_DIRECTORY: './cypress/snapshots/base',
|
|
|
|
SNAPSHOT_DIFF_DIRECTORY: './cypress/snapshots/diff',
|
|
|
|
},
|
2022-06-08 15:02:09 +03:00
|
|
|
e2e: {
|
2024-02-26 14:16:33 +03:00
|
|
|
env: {
|
|
|
|
visualRegressionType: 'regression',
|
|
|
|
},
|
2022-06-08 15:02:09 +03:00
|
|
|
setupNodeEvents(on, config) {
|
2024-05-14 12:36:56 +03:00
|
|
|
on('file:preprocessor', vitePreprocessor({
|
|
|
|
plugins: [vue()],
|
|
|
|
configFile: false,
|
|
|
|
}))
|
2023-10-11 21:14:03 +03:00
|
|
|
cypressSplit(on, config)
|
2024-02-26 14:16:33 +03:00
|
|
|
configureVisualRegression(on)
|
2023-10-11 21:14:03 +03:00
|
|
|
|
|
|
|
return config
|
2022-06-08 15:02:09 +03:00
|
|
|
},
|
2022-06-25 01:10:50 +03:00
|
|
|
|
2022-06-08 15:02:09 +03:00
|
|
|
baseUrl: 'http://localhost:8081/index.php/',
|
|
|
|
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
|
|
|
|
},
|
2024-01-17 22:28:29 +03:00
|
|
|
component: {
|
|
|
|
devServer: {
|
|
|
|
framework: "vue",
|
2024-02-06 20:31:38 +03:00
|
|
|
bundler: "vite",
|
2024-01-17 22:28:29 +03:00
|
|
|
},
|
|
|
|
},
|
2022-08-31 11:22:36 +03:00
|
|
|
retries: {
|
2022-09-26 17:58:03 +03:00
|
|
|
runMode: 2,
|
2022-08-31 11:22:36 +03:00
|
|
|
// do not retry in `cypress open`
|
2022-09-26 17:58:03 +03:00
|
|
|
openMode: 0,
|
2022-08-31 11:22:36 +03:00
|
|
|
},
|
2023-11-29 17:47:18 +03:00
|
|
|
'numTestsKeptInMemory': 5,
|
2022-06-01 22:58:06 +03:00
|
|
|
})
|