generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
60 lines (59 loc) · 2.38 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
import { defineConfig } from 'cypress'
import { resetStubs } from './integration_tests/mockApis/wiremock'
import auth from './integration_tests/mockApis/auth'
import tokenVerification from './integration_tests/mockApis/tokenVerification'
import manageOffencesApi from './integration_tests/mockApis/manageOffencesApi'
import components from './integration_tests/mockApis/components'
import remandAndSentencingApi from './integration_tests/mockApis/remandAndSentencingApi'
import documentManagementApi from './integration_tests/mockApis/documentManagementApi'
import prisonerSearchApi from './integration_tests/mockApis/prisonerSearchApi'
import prisonApi from './integration_tests/mockApis/prisonApi'
import courtRegisterApi from './integration_tests/mockApis/courtRegisterApi'
import calculateReleaseDatesApi from './integration_tests/mockApis/calculateReleaseDatesApi'
import courtCasesReleaseDatesApi from './integration_tests/mockApis/courtCasesReleaseDatesApi'
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) {
on('task', {
reset: resetStubs,
happyPathStubs: async () => {
await resetStubs()
return Promise.all([
auth.stubSignIn(),
prisonerSearchApi.stubGetPrisonerDetails(),
components.stubComponents(),
prisonApi.stubGetPrisonerImage(),
prisonApi.stubGetUserCaseload(),
courtRegisterApi.stubSearchCourt(),
remandAndSentencingApi.stubSearchSentenceTypes(),
remandAndSentencingApi.stubGetAllAppearanceTypes(),
])
},
...auth,
...tokenVerification,
...manageOffencesApi,
...components,
...remandAndSentencingApi,
...documentManagementApi,
...prisonerSearchApi,
...prisonApi,
...courtRegisterApi,
...calculateReleaseDatesApi,
...courtCasesReleaseDatesApi,
})
},
baseUrl: 'http://localhost:3007',
excludeSpecPattern: '**/!(*.cy).ts',
specPattern: 'integration_tests/e2e/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'integration_tests/support/index.ts',
},
})