generated from hmcts/ccd-client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile_nightly
159 lines (142 loc) · 6.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
#!groovy
properties([
pipelineTriggers([cron('45 16 * * 1-5')]),
parameters([
string(name: 'ENVIRONMENT', defaultValue: 'aat', 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/loginUser', description: 'Idam 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-${env}': [
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')
],
's2s-${env}': [
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) {
// triggers {
// cron(env.BRANCH_NAME == 'master' ? 'H 8 * * 1-5' : '')
// }
loadVaultSecrets(secrets)
enableFullFunctionalTest(int timeout=300)
//enableCrossBrowserTest()
//enableFortifyScan()
//enableSecurityScan()
env.TEST_URL = params.ET_SYA_URL_TO_TEST
env.IDAM_URL = params.IDAM_URL
env.TESTMANAGE_CASE_URL = params.CCD_CALLBACK_URL
env.ET_CASE_API_URL = params.ET_CASE_API_URL
env.RUNNING_ENV = params.ENVIRONMENT
before('fullFunctionalTest') {
yarnBuilder.yarn('yarn-update')
yarnBuilder.yarn('install-dependencies')
}
afterAlways('fullFunctionalTest') {
stage('Functional UI tests chromium') {
try {
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/**'
}
}
}
}