generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.ts
63 lines (57 loc) · 1.97 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { defineConfig } from 'cypress'
import { fakerEN_GB as faker } from '@faker-js/faker'
import { resetStubs } from './integration_tests/mockApis/wiremock'
import auth from './integration_tests/mockApis/auth'
import tokenVerification from './integration_tests/mockApis/tokenVerification'
import cemo from './integration_tests/mockApis/cemo'
import fms from './integration_tests/mockApis/fms'
import hmppsDocumentManagement from './integration_tests/mockApis/hmppsDocumentManagement'
export default defineConfig({
chromeWebSecurity: false,
fixturesFolder: 'integration_tests/fixtures',
screenshotsFolder: 'integration_tests/screenshots',
videosFolder: 'integration_tests/videos',
reporter: 'cypress-multi-reporters',
reporterOptions: {
configFile: 'reporter-config.json',
},
taskTimeout: 60000,
e2e: {
setupNodeEvents(on) {
const seed = faker.seed(Math.random() * Number.MAX_SAFE_INTEGER)
// eslint-disable-next-line no-console
console.log(`Random seed: ${seed}`)
on('task', {
reset: resetStubs,
...auth,
...tokenVerification,
...cemo,
...fms,
...hmppsDocumentManagement,
/*
* used to output summary accessibility testing issues found to console during integration testing
*/
log(message) {
// eslint-disable-next-line no-console
console.log(message)
return null
},
/*
* used to output table accessibility testing details found to console during integration testing
*/
table(message) {
// eslint-disable-next-line no-console
console.table(message)
return null
},
})
},
baseUrl: 'http://localhost:3007',
excludeSpecPattern: '**/!(*.cy).ts',
specPattern: [
'integration_tests/e2e/**/*.cy.{js,jsx,ts,tsx}',
'integration_tests/scenarios/**/*.cy.{js,jsx,ts,tsx}',
],
supportFile: 'integration_tests/support/index.ts',
},
})