generated from hmcts/ccd-client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile_nightly
195 lines (179 loc) · 8.69 KB
/
Jenkinsfile_nightly
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#!groovy
properties([
pipelineTriggers([cron('45 16 * * 1-5')]),
parameters([
choice(name: 'ENVIRONMENT_VARS', choices: ['aat', 'demo'], description: 'Environment to test'),
string(name: 'ET_SYA_URL_TO_TEST', defaultValue: 'https://et-sya.aat.platform.hmcts.net/', description: 'The URL you want to run these tests against'),
string(name: 'ET_SYR_URL_TO_TEST', defaultValue: 'https://et-syr.aat.platform.hmcts.net/', description: 'The URL you want to run these tests against'),
string(name: 'IDAM_URL', defaultValue: 'https://idam-api.aat.platform.hmcts.net/testing-support/accounts', description: 'Idam url'),
string(name: 'MANAGE_ORG_URL', defaultValue: 'https://manage-org.aat.platform.hmcts.net', description: 'Manage org url'),
string(name: 'CCD_CALLBACKS_URL', defaultValue: 'https://manage-case.aat.platform.hmcts.net/cases', description: 'ccd url'),
string(name: 'ET_CASE_API_URL', defaultValue: 'http://et-sya-api-aat.service.core-compute-aat.internal/cases/initiate-case/', description: 'The Url for creating draft cases'),
string(name: 'ET_SUBMIT_DRAFT_CASE_URL', defaultValue: 'http://et-sya-api-aat.service.core-compute-aat.internal/cases/submit-case/', description: 'The Endpoint for submitting a darft case'),
])
])
@Library("Infrastructure")
def product = "et"
def component = "frontend"
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
def inTestTrue = [
'et-${env}': [
secret('true', 'IN_TEST')
]
]
def inTestFalse = [
'et-${env}': [
secret('', 'IN_TEST')
]
]
def secrets = [
'et-${env}': [
secret('et-citizen-4-username', 'TEST_CASE_USERNAME'),
secret('et-claimant-password', 'TEST_CASE_PASSWORD'),
secret('idam-account-url', 'IDAM_ACCOUNT_URL'),
secret('api-key', 'API_KEY'),
],
"et-cos-${params.ENVIRONMENT_VARS}": [
secret('et-caseworker-5-username', 'ET_CASEWORKER_USER_NAME'),
secret('et-caseworker-5-password', 'ET_CASEWORKER_PASSWORD'),
secret('et-legalrep-user-name', 'ET_LEGALREP_USER_NAME'),
secret('et-legalrep-password', 'ET_LEGALREP_PASSWORD'),
secret('et-wa-legal-ops-user-name', 'ET_LEGAL_OPS_USER_NAME'),
secret('et-wa-legal-ops-password', 'ET_LEGAL_OPS_PASSWORD'),
secret('et-ctsc-admin-user-name', 'ET_CTSC_ADMIN_USER_NAME'),
secret('et-ctsc-admin-password', 'ET_CTSC_ADMIN_PASSWORD'),
secret('et-hearing-judge-user-name-scotland', 'ET_HEARING_JUDGE_USER_NAME_SCOT'),
secret('et-hearing-judge-user-name-eng', 'ET_HEARING_JUDGE_USER_NAME_ENG'),
secret('et-hearing-admin-user-name-eng', 'ET_HEARING_ADMIN_USER_NAME_ENG'),
secret('et-hearing-admin-user-name-scot', 'ET_HEARING_ADMIN_USER_NAME_SCOT'),
secret('et-citizen-user-name', 'ET_CITIZEN_USER_NAME'),
secret('et-citizen-password', 'ET_CITIZEN_PASSWORD'),
secret('et-ccd-api-user-name','ET_CCD_API_USER_NAME'),
secret('et-ccd-api-password','ET_CCD_API_PASSWORD'),
secret('et-judge-user-name-eng','ET_JUDGE_USER_NAME_ENG'),
secret('et-judge-user-eng-password','ET_JUDGE_USER_ENG_PASSWORD'),
secret('et3-resp-user-name','ET3_REPSONDENT_USER_NAME'),
secret('et3-resp-password','ET3_REPSONDENT_PASSWORD'),
secret('et-resp-user-name','ET_REPSONDENT_USER_NAME'),
secret('et-resp-password','ET_REPSONDENT_PASSWORD'),
secret('et-manage-org-username','ET_MANAGE_ORG_USERNAME'),
secret('et-manage-org-password','ET_MANAGE_ORG_PASSWORD'),
secret('et-judge-user-name-wa','ET_JUDGE_USER_NAME_WORKALLOCATION'),
secret('et-judge-user-password-wa','ET_JUDGE_USER_PASSWORD_WORKALLOCATION'),
],
"s2s-${params.ENVIRONMENT_VARS}": [
secret('microservicekey-ccd-gw', 'MICROSERVICE_CCD_GW')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withNightlyPipeline("nodejs", product, component) {
loadVaultSecrets(secrets)
env.TEST_URL_CITIZEN_UI = params.ET_SYA_URL_TO_TEST
env.IDAM_URL = params.IDAM_URL
env.TEST_MANAGE_CASE_URL = params.CCD_CALLBACKS_URL
env.ET_CASE_API_URL = params.ET_CASE_API_URL
env.RUNNING_ENV = params.ENVIRONMENT_VARS
env.TEST_RESP_URL = params.ET_SYR_URL_TO_TEST
before('DependencyCheckNightly') {
yarnBuilder.yarn('yarn-update')
yarnBuilder.yarn('install-dependencies')
}
afterAlways('DependencyCheckNightly') {
stage('Smoke test') {
try {
yarnBuilder.yarn('test:smoke')
} catch (Error) {
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
} finally {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : 'playwright-report',
reportFiles : 'index.html',
reportName : 'ET Smoke Test Report'
])
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**'
}
}
stage('Accessibility tests') {
try {
yarnBuilder.yarn('test:accessibility')
} catch (Error) {
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
} finally {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : 'playwright-report',
reportFiles : 'index.html',
reportName : 'ET Accessibility Test Report'
])
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**'
}
}
stage('Functional UI tests chromium') {
try {
if(params.ENVIRONMENT_VARS == 'demo') {
yarnBuilder.yarn('test:functional-chromium-demo')
} else {
yarnBuilder.yarn('test:functional-chromium')
}
} catch (Error) {
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
} finally {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'playwright-report',
reportFiles: 'index.html',
reportName: 'UITestChromiumReport'
])
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**'
}
}
stage('Functional UI tests firefox') {
try {
yarnBuilder.yarn('test:functional-firefox')
} catch (Error) {
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
} finally {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'playwright-report',
reportFiles: 'index.html',
reportName: 'UITestFirefoxReport'
])
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**'
}
}
stage('Functional UI tests webkit ') {
try {
yarnBuilder.yarn('test:functional-webkit')
} catch (Error) {
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
} finally {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'playwright-report',
reportFiles: 'index.html',
reportName: 'UITestWebkitReport'
])
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**'
}
}
}
}