Skip to content

Commit 5aa66b8

Browse files
merge nightly changes Sep (#395)
merge nightly dev Sep
1 parent 3c7cf01 commit 5aa66b8

17 files changed

+1676
-9907
lines changed

Diff for: Jenkinsfile_nightly

+90-61
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ properties([
1717

1818
def product = "et"
1919
def component = "frontend"
20+
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
2021
def inTestTrue = [
2122
'et-${env}': [
2223
secret('true', 'IN_TEST')
@@ -31,26 +32,34 @@ def inTestFalse = [
3132

3233

3334
def secrets = [
34-
'et-${env}': [
35-
secret('et-citizen-4-username', 'TEST_CASE_USERNAME'),
36-
secret('et-claimant-password', 'TEST_CASE_PASSWORD'),
37-
secret('idam-account-url', 'IDAM_ACCOUNT_URL'),
38-
secret('api-key', 'API_KEY'),
39-
],
40-
'et-cos-${env}': [
41-
secret('et-caseworker-5-username', 'ET_CASEWORKER_USER_NAME'),
42-
secret('et-caseworker-5-password', 'ET_CASEWORKER_PASSWORD'),
43-
secret('et-legalrep-user-name', 'ET_LEGALREP_USER_NAME'),
44-
secret('et-legalrep-password', 'ET_LEGALREP_PASSWORD'),
45-
secret('et-wa-legal-ops-user-name', 'ET_LEGAL_OPS_USER_NAME'),
46-
secret('et-wa-legal-ops-password', 'ET_LEGAL_OPS_PASSWORD'),
47-
secret('et-ctsc-admin-user-name', 'ET_CTSC_ADMIN_USER_NAME'),
48-
secret('et-ctsc-admin-password', 'ET_CTSC_ADMIN_PASSWORD'),
49-
secret('et-hearing-judge-user-name-scotland', 'ET_HEARING_JUDGE_USER_NAME_SCOT'),
50-
secret('et-hearing-judge-user-name-eng', 'ET_HEARING_JUDGE_USER_NAME_ENG'),
51-
secret('et-hearing-admin-user-name-eng', 'ET_HEARING_ADMIN_USER_NAME_ENG'),
52-
secret('et-hearing-admin-user-name-scot', 'ET_HEARING_ADMIN_USER_NAME_SCOT'),
53-
]
35+
'et-${env}': [
36+
secret('et-citizen-4-username', 'TEST_CASE_USERNAME'),
37+
secret('et-claimant-password', 'TEST_CASE_PASSWORD'),
38+
secret('idam-account-url', 'IDAM_ACCOUNT_URL'),
39+
secret('api-key', 'API_KEY'),
40+
],
41+
'et-cos-${env}': [
42+
secret('et-caseworker-5-username', 'ET_CASEWORKER_USER_NAME'),
43+
secret('et-caseworker-5-password', 'ET_CASEWORKER_PASSWORD'),
44+
secret('et-legalrep-user-name', 'ET_LEGALREP_USER_NAME'),
45+
secret('et-legalrep-password', 'ET_LEGALREP_PASSWORD'),
46+
secret('et-wa-legal-ops-user-name', 'ET_LEGAL_OPS_USER_NAME'),
47+
secret('et-wa-legal-ops-password', 'ET_LEGAL_OPS_PASSWORD'),
48+
secret('et-ctsc-admin-user-name', 'ET_CTSC_ADMIN_USER_NAME'),
49+
secret('et-ctsc-admin-password', 'ET_CTSC_ADMIN_PASSWORD'),
50+
secret('et-hearing-judge-user-name-scotland', 'ET_HEARING_JUDGE_USER_NAME_SCOT'),
51+
secret('et-hearing-judge-user-name-eng', 'ET_HEARING_JUDGE_USER_NAME_ENG'),
52+
secret('et-hearing-admin-user-name-eng', 'ET_HEARING_ADMIN_USER_NAME_ENG'),
53+
secret('et-hearing-admin-user-name-scot', 'ET_HEARING_ADMIN_USER_NAME_SCOT'),
54+
secret('et-citizen-user-name', 'ET_CITIZEN_USER_NAME'),
55+
secret('et-citizen-password', 'ET_CITIZEN_PASSWORD'),
56+
secret('et-ccd-api-user-name','ET_CCD_API_USER_NAME'),
57+
secret('et-ccd-api-password','ET_CCD_API_PASSWORD')
58+
59+
],
60+
's2s-${env}': [
61+
secret('microservicekey-ccd-gw', 'MICROSERVICE_CCD_GW')
62+
]
5463
]
5564

5665
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
@@ -63,61 +72,81 @@ static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
6372
}
6473

6574
withNightlyPipeline("nodejs", product, component) {
75+
// triggers {
76+
// cron(env.BRANCH_NAME == 'master' ? 'H 8 * * 1-5' : '')
77+
// }
6678
loadVaultSecrets(secrets)
6779
enableFullFunctionalTest(int timeout=300)
68-
enableCrossBrowserTest()
80+
//enableCrossBrowserTest()
6981
//enableFortifyScan()
7082
//enableSecurityScan()
7183

7284
env.TEST_URL = params.ET_SYA_URL_TO_TEST
7385
env.IDAM_URL = params.IDAM_URL
74-
env.TESTMANAGE_CASE_URL = params.CCD_CALLBACK_URL
86+
env.TESTMANAGE_CASE_URL = params.CCD_CALLBACK_URL
7587
env.ET_CASE_API_URL = params.ET_CASE_API_URL
7688
env.RUNNING_ENV = params.ENVIRONMENT
7789

78-
before('crossBrowserTest') {
79-
sh """
80-
yarn playwright install
81-
"""
90+
before('fullFunctionalTest') {
91+
yarnBuilder.yarn('yarn-update')
92+
yarnBuilder.yarn('install-dependencies')
8293
}
8394

84-
afterAlways('crossBrowserTest') {
85-
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
86-
sh """
87-
yarn playwright install
88-
"""
89-
}
9095

9196
afterAlways('fullFunctionalTest') {
92-
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
93-
94-
publishHTML target: [
95-
allowMissing : true,
96-
alwaysLinkToLastBuild: true,
97-
keepAll : true,
98-
reportDir : "functional-output/e2e/reports",
99-
reportFiles : "ET-XUI-E2E.html",
100-
reportName : "ET E2E tests result"
101-
]
102-
}
103-
104-
afterAlways('smoketest:aat') {
105-
loadVaultSecrets(inTestTrue)
106-
stage('Accessibility') {
107-
yarnBuilder.yarn('tests:a11y')
108-
publishHTML([
109-
allowMissing : true,
110-
alwaysLinkToLastBuild: true,
111-
keepAll : true,
112-
reportDir : "functional-output/accessibility-report",
113-
reportFiles : 'a11y.html',
114-
reportName : 'Accessibility results'
115-
])
97+
stage('Functional UI tests chromium') {
98+
try {
99+
yarnBuilder.yarn('test:functional-chromium')
100+
} catch (Error) {
101+
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
102+
} finally {
103+
publishHTML([
104+
allowMissing: true,
105+
alwaysLinkToLastBuild: true,
106+
keepAll: true,
107+
reportDir: 'playwright-report',
108+
reportFiles: 'index.html',
109+
reportName: 'UITestChromiumReport'
110+
])
111+
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**'
112+
}
113+
}
114+
stage('Functional UI tests firefox') {
115+
try {
116+
yarnBuilder.yarn('test:functional-firefox')
117+
} catch (Error) {
118+
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
119+
} finally {
120+
publishHTML([
121+
allowMissing: true,
122+
alwaysLinkToLastBuild: true,
123+
keepAll: true,
124+
reportDir: 'playwright-report',
125+
reportFiles: 'index.html',
126+
reportName: 'UITestFirefoxReport'
127+
])
128+
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**'
129+
}
130+
}
131+
stage('Functional UI tests webkit ') {
132+
try {
133+
yarnBuilder.yarn('test:functional-webkit')
134+
} catch (Error) {
135+
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
136+
} finally {
137+
publishHTML([
138+
allowMissing: true,
139+
alwaysLinkToLastBuild: true,
140+
keepAll: true,
141+
reportDir: 'playwright-report',
142+
reportFiles: 'index.html',
143+
reportName: 'UITestWebkitReport'
144+
])
145+
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'playwright-report/**'
146+
}
116147
}
117-
loadVaultSecrets(inTestFalse)
118-
sh """
119-
yarn playwright install
120-
"""
121148
}
122-
123149
}
150+
151+
152+

Diff for: README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,9 @@ $ yarn playwright test --ui
6464

6565
To debug the e2e test
6666
```
67-
$ yarn playwright test debug
67+
$ yarn playwright test --debug
6868
```
69+
70+
To run codegen tool
71+
```
72+
$ npx playwright codegen

Diff for: package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
"license": "hmcts",
99
"private": true,
1010
"scripts": {
11-
"test:fullfunctional": "rm -rf coverage functional-output && codeceptjs run -c codecept.conf.js --verbose --reporter mocha-multi --grep @nightly",
11+
"test:fullfunctional": "yarn playwright install chromium && yarn playwright test --project=chromium --grep @smoke",
12+
"test:functional-chromium": "yarn playwright install chromium && yarn playwright test --project=chromium",
13+
"test:functional-webkit": "yarn playwright install webkit && yarn playwright test --project=webkit --grep @cx",
14+
"test:functional-firefox": "yarn playwright install firefox && yarn playwright test --project=firefox --grep @cx",
15+
"test:crossbrowser": "yarn playwright install firefox && yarn playwright install webkit && yarn playwright test --project=webkit --project=firefox --grep @cx",
1216
"test:local": "rm -rf functional-output && DEBUG='codeceptjs:heal' && codeceptjs run --ai -c codecept.conf.js --verbose --reporter mocha-multi",
1317
"parallel": "codeceptjs run --steps -c codecept.conf.js run-multiple parallel",
1418
"codeceptjs:headless": "HEADLESS=true codeceptjs run --steps",
@@ -18,23 +22,19 @@
1822
"codeceptjs:demo": "codeceptjs run --steps -c node_modules/@codeceptjs/examples/codecept.webdriver.conf.js",
1923
"codeceptjs:demo:headless": "HEADLESS=true codeceptjs run --steps -c node_modules/@codeceptjs/examples/codecept.webdriver.conf.js",
2024
"codeceptjs:demo:ui": "codecept-ui --app -c node_modules/@codeceptjs/examples/codecept.webdriver.conf.js",
21-
"test:crossbrowser": "codeceptjs run-workers 2 profile1 -c saucelabs.conf.js --grep @RET-XB --reporter mocha-multi --verbose",
2225
"test:profile": "SAUCE_TUNNEL_NAME=sunnyayeni_tunnel_name yarn test:fullfunctional --steps -c saucelabs.conf.js --profile sauce:chrome,firefox,safari",
2326
"prepare": "husky install",
24-
"tests:a11y": "NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_ENV=test LOG_LEVEL=ERROR mocha --exit --reporter mochawesome --require ts-node/register --require tsconfig-paths/register src/test/a11y/a11y.ts --timeout 60000 --reporter-options reportDir=functional-output/accessibility-report,reportFilename=a11y,inlineAssets=true,reportTitle=et-xui-e2e-tests"
27+
"yarn-update": "yarn set version 3.x",
28+
"install-dependencies": "/usr/bin/yarn install --silent"
2529
},
2630
"lint-staged": {
2731
"test/**/*.{js,jsx,ts,tsx}": "eslint"
2832
},
2933
"dependencies": {
3034
"@faker-js/faker": "8.4.1",
31-
"@wdio/cli": "8.36.0",
32-
"@wdio/sauce-service": "8.36.0",
33-
"@wdio/selenium-standalone-service": "8.15.0",
34-
"@wdio/types": "8.36.0",
35+
"@noble/hashes": "^1.5.0",
36+
"axios": "^1.7.4",
3537
"chance": "^1.1.11",
36-
"codeceptjs-saucehelper": "1.4.0",
37-
"codeceptjs-saucelabs": "5.3.2",
3838
"eslint": "9.9.1",
3939
"eslint-config-prettier": "9.1.0",
4040
"eslint-plugin-codeceptjs": "1.3.0",
@@ -48,15 +48,15 @@
4848
"mocha-multi": "1.1.7",
4949
"mochawesome": "7.1.3",
5050
"openai": "^4.47.1",
51-
"playwright": "^1.27.1",
5251
"prettier": "3.2.5",
52+
"totp-generator": "1.0.0",
5353
"typescript": "5.4.5"
5454
},
5555
"devDependencies": {
56-
"@codeceptjs/configure": "1.0.1",
57-
"@codeceptjs/examples": "1.2.4",
58-
"@codeceptjs/ui": "1.1.1",
59-
"codeceptjs": "^3.6.2-beta.1",
56+
"@playwright/test": "^1.45.3",
57+
"@types/chai-as-promised": "^7.1.5",
58+
"@types/chance": "^1.1.6",
59+
"@types/node": "^20.14.11",
6060
"config": "^3.3.9",
6161
"husky": "9.0.11",
6262
"nyc": "^15.1.0",

Diff for: playwrighte2e/data/et-ccd-basic-data.json

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"data": {
3+
"jurCodesCollection": [
4+
{
5+
"id": "f7f10b22-88c0-43b9-a917-f7fff81e006y",
6+
"value": {
7+
"juridictionCodesList": "DAG"
8+
}
9+
}
10+
],
11+
"typesOfClaim": [
12+
"discrimination"
13+
],
14+
"positionType": "ET1 Online submission",
15+
"conciliationTrack": "Open Track",
16+
"receiptDate": "2019-08-17",
17+
"feeGroupReference": "",
18+
"managingOffice": "Leeds",
19+
"stateAPI": null,
20+
"caseRefNumberCount": null,
21+
"startCaseRefNumber": null,
22+
"multipleRefNumber": null,
23+
"caseType": "Single",
24+
"multipleReference": null,
25+
"leadClaimant": null,
26+
"claimant_TypeOfClaimant": "Individual",
27+
"claimant_Company": null,
28+
"claimantIndType": {
29+
"claimant_title1": "Dr",
30+
"claimant_title_other": null,
31+
"claimant_first_names": "Grayson",
32+
"claimant_last_name": "Becker",
33+
"claimant_date_of_birth": "1998-12-15",
34+
"claimant_gender": "Male"
35+
},
36+
"claimantType": {
37+
"claimant_phone_number": null,
38+
"claimant_mobile_number": null,
39+
"claimant_email_address": null,
40+
"claimant_contact_preference": null,
41+
"claimant_addressUK": {
42+
"AddressLine1": "4 Little Meadows",
43+
"AddressLine2": "",
44+
"AddressLine3": "",
45+
"PostTown": "Bradley",
46+
"County": "",
47+
"Country": "United Kingdom",
48+
"PostCode": "LL11 4AR"
49+
}
50+
},
51+
"respondentCollection": [
52+
{
53+
"value": {
54+
"respondent_name": "Mrs Test Auto",
55+
"respondent_ACAS_question": "Yes",
56+
"respondent_ACAS": "15678",
57+
"respondent_ACAS_no": null,
58+
"respondent_phone1": null,
59+
"responseReceived": "Yes",
60+
"responseContinue": null,
61+
"responseReceivedDate": null,
62+
"responseStruckOut": null,
63+
"responseRespondentName": null,
64+
"responseReference": null,
65+
"response_status": null,
66+
"responseToClaim": null,
67+
"rejection_reason": null,
68+
"rejection_reason_other": null,
69+
"responseOutOfTime": null,
70+
"responseNotOnPrescribedForm": null,
71+
"responseRequiredInfoAbsent": null,
72+
"responseStruckOutDate": null,
73+
"responseStruckOutChairman": null,
74+
"responseStruckOutReason": null,
75+
"respondent_phone2": null,
76+
"respondent_email": null,
77+
"respondent_contact_preference": null,
78+
"responseRespondentPhone1": null,
79+
"responseRespondentPhone2": null,
80+
"responseRespondentEmail": null,
81+
"responseRespondentContactPreference": null,
82+
"response_referred_to_judge": null,
83+
"response_returned_from_judge": null,
84+
"responseNotes": null,
85+
"respondent_address": {
86+
"AddressLine1": "78 East Wonford Hill",
87+
"AddressLine2": "",
88+
"AddressLine3": "",
89+
"PostTown": "Exeter",
90+
"County": "",
91+
"Country": "United Kingdom",
92+
"PostCode": "EX1 3DD"
93+
},
94+
"responseRespondentAddress": {
95+
"AddressLine1": null,
96+
"AddressLine2": null,
97+
"AddressLine3": null,
98+
"PostTown": null,
99+
"County": null,
100+
"PostCode": null,
101+
"Country": null
102+
}
103+
},
104+
"id": "e764f874-e937-4642-ac67-4af2e2fd05f6"
105+
}
106+
],
107+
"claimantWorkAddressQuestion": "No",
108+
"claimantWorkAddress": {
109+
"claimant_work_address": {
110+
"Country": "United Kingdom",
111+
"PostCode": "MK5 7HH",
112+
"PostTown": "Milton Keynes",
113+
"AddressLine1": "The Burnt Oak",
114+
"AddressLine2": "Egerton Gate",
115+
"AddressLine3": "Shenley Brook End"
116+
}
117+
},
118+
"claimantWorkAddressQRespondent": {
119+
"value": {
120+
"code": "Mrs Test Auto",
121+
"label": "Mrs Test Auto - 78 East Wonford Hill, Exeter, EX1 3DD, United Kingdom"
122+
},
123+
"list_items": [
124+
{
125+
"code": "Mrs Test Auto",
126+
"label": "Mrs Test Auto - 78 East Wonford Hill, Exeter, EX1 3DD, United Kingdom"
127+
}
128+
]
129+
},
130+
"claimantOtherType": null,
131+
"claimantRepresentedQuestion": "No",
132+
"representativeClaimantType": null
133+
}
134+
}

0 commit comments

Comments
 (0)