-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcypress.config.ts
41 lines (37 loc) · 1.25 KB
/
cypress.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { defineConfig } from 'cypress'
import createBundler from '@bahmutov/cypress-esbuild-preprocessor'
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'
import createEsbuildPlugin from '@badeball/cypress-cucumber-preprocessor/esbuild'
import getCompareSnapshotsPlugin from 'cypress-image-diff-js/dist/plugin.js'
import { getCurrentDate } from './utils/config-helpers'
export default defineConfig({
e2e: {
viewportWidth: 1920,
viewportHeight: 1080,
specPattern: '**/*.feature',
supportFile: 'cypress/support/index.ts',
reporter: 'mochawesome',
reporterOptions: {
reportFilename: '[status]_[datetime]-[name]-report',
charts: true,
embeddedScreenshots: true,
inlineAssets: true,
saveAllAttempts: false,
reportDir: 'cypress/reports/' + getCurrentDate(),
},
async setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config)
on(
'file:preprocessor',
createBundler({
plugins: [createEsbuildPlugin(config)],
})
)
getCompareSnapshotsPlugin(on, config)
return config
},
},
})