Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,14 @@ withPipeline(type, product, component) {
} else {
echo 'Running opal component tests (no skip label present)'
try {
yarnBuilder.yarn('test:opalComponent')
yarnBuilder.yarn('test:component')
} catch (hudson.AbortException e) {
echo "Opal component tests failed: ${e}"
currentBuild.result = 'FAILURE'
} finally {
archiveArtifact(functionalArtifactsGlob)
publishHtmlReport(
"functional-output/component-html/${resolvedBrowserToRun()}/",
"functional-output/component/${resolvedBrowserToRun()}/html/",
'component-report.html',
"Component Test Report (${resolvedBrowserToRun()})"
)
Expand Down
13 changes: 4 additions & 9 deletions Jenkinsfile_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,11 @@ void runComponentStage(
) {
runNightlyStage(enabled, 'Component Tests', failureResultValue, 'Component tests failed') {
try {
builder.yarn(shouldRunWithZephyr ? 'zephyr:test:opalComponent' : 'test:opalComponent')
builder.yarn(shouldRunWithZephyr ? 'zephyr:test:component' : 'test:component')
} finally {
archiveArtifact(functionalProdArtifactsPath)
archiveArtifact("functional-output/screenshots/${browserToRun}/component/**")
archiveArtifact("functional-output/component/${browserToRun}/**")
publishHtmlReport(
"functional-output/component-html/${browserToRun}/",
"functional-output/component/${browserToRun}/html/",
'component-report.html',
"Component Test Report (${browserToRun})"
)
Expand Down Expand Up @@ -521,11 +520,7 @@ void runLegacyStage(
) {
runNightlyStage(enabled, 'Legacy Tests', failureResultValue, 'Legacy tests failed') {
try {
builder.yarn(
'yarn test:functionalLegacy ; ' +
'yarn test:functionalLegacy:combine:reports ; ' +
'yarn test:functionalLegacy:cucumber:combineParallelReport'
)
builder.yarn('test:functional --mode=legacy')
} finally {
archiveArtifact("functional-output/prod/${browserToRun}/legacy/**")
archiveArtifact("functional-output/screenshots/${browserToRun}/legacy/**")
Expand Down
99 changes: 94 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,32 @@ TAGS=@UAT-Technical yarn test:functional:tags

```

### Legacy mode
Run `yarn test:component` to execute the Cypress component suite.

To run Opal functional tests in legacy app mode, used for UAT-Technical coverage:
All three top-level runners accept:

- `--browser=<chrome|edge|firefox>` for an explicit browser
- `--mode=<opal|legacy>` for suite mode selection
- `--parallel` or `--serial` to override the default execution style

Examples:

```bash

yarn test:component --browser=chrome --parallel
yarn test:smoke --mode=legacy --serial
yarn test:functional --browser=firefox --mode=opal --parallel

```

### Legacy app mode

To run the UAT-Technical-tagged functional tests against legacy app mode locally:
This keeps the functional suite on the normal OPAL spec tree and only switches the app/helpers into legacy mode.

```bash

yarn test:functional:uat-legacy
yarn test:functional:uat_legacy

```

Expand All @@ -302,7 +321,77 @@ yarn cypress

### Reports

Artifacts and reports are written to `smoke-output/` and `functional-output/`, using browser-specific subdirectories where applicable.
After a clean run, artifacts and reports are written to `functional-output/` and `smoke-output/`.
Replace `<browser>` with `chrome`, `edge`, or `firefox`.

```text
functional-output/
component/
<browser>/
html/
component-report.html
assets/...
json/
.jsons/
mochawesome*.json
junit/
component-test-output-*.xml
screenshots/...
prod/
<browser>/
opal-mode-test-output-*.xml
<browser>-test-result.xml
cucumber/
OPAL-report-*.ndjson
<browser>-report.ndjson
<browser>-report.html
legacy/
legacy-mode-test-output-*.xml
legacy-test-result.xml
cucumber/
LEGACY-report-*.ndjson
legacy-report.ndjson
legacy-report.html
screenshots/
<browser>/...
<browser>/legacy/...
videos/...
zephyr/
cypress-report-1.json
cucumber-report.json
temp/...
account_evidence/...

smoke-output/
prod/
<browser>/
opal-mode-test-output-*.xml
<browser>-test-result.xml
cucumber/
OPAL-report-*.ndjson
smoke-report.ndjson
smoke-report.html
legacy/
legacy-mode-test-output-*.xml
legacy-test-result.xml
cucumber/
LEGACY-report-*.ndjson
legacy-report.ndjson
legacy-report.html
screenshots/
<browser>/...
<browser>/legacy/...
zephyr/
cucumber-report.json
```

Notes:

- `functional-output/component/<browser>/json/.jsons/` is the raw Mochawesome JSON used to build `html/component-report.html`.
- `functional-output/prod/<browser>/legacy/` and `smoke-output/prod/<browser>/legacy/` are only created for legacy-mode runs.
- `videos/` is only expected when using `yarn test:functionalOpalVideo`.
- `account_evidence/` is only expected when legacy evidence capture is enabled.
- These older component paths should not be recreated on a clean run: `functional-output/component-report/`, `functional-output/component-html/`, and `functional-output/prod/<browser>/component/`.

## Running accessibility tests

Expand Down Expand Up @@ -496,7 +585,7 @@ Zephyr Automation is a tool for integrating test results and ticket management b
- `zephyr:cucumber:smoke:jira-create`: Create Jira tickets from the smoke Cucumber JSON report at `smoke-output/zephyr/cucumber-report.json`.
- `zephyr:cucumber:smoke:jira-update`: Update Jira tickets using the smoke Cucumber JSON report at `smoke-output/zephyr/cucumber-report.json`.
- `zephyr:cucumber:smoke:jira-execute`: Create a Zephyr execution from the smoke Cucumber JSON report at `smoke-output/zephyr/cucumber-report.json`.
- `zephyr:test:opalComponent`: Reset outputs, run component tests, then create a Zephyr execution from the Cypress JSON report.
- `zephyr:test:component`: Reset outputs, run component tests, then create a Zephyr execution from the Cypress JSON report.
- `zephyr:test:functional`: Reset outputs, run functional tests, then create a Zephyr execution from the functional Cucumber JSON report.
- `zephyr:test:smoke`: Reset outputs, run smoke tests, then create a Zephyr execution from the smoke Cucumber JSON report.

Expand Down
21 changes: 18 additions & 3 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"impositions",
"inputname",
"inputvalue",
"JCDE",
"lastname",
"linters",
"LJA",
Expand Down Expand Up @@ -121,12 +122,26 @@
"VPFPO",
"ZWNJ"
],
"ignorePaths": ["node_modules", "dist", "coverage", ".husky", "*.lock", "**/*.snap", "**/generated/**"],
"ignorePaths": [
"node_modules",
"dist",
"coverage",
".husky",
"*.lock",
"**/*.snap",
"**/generated/**"
],
"ignoreRegExpList": [
"/^\\s*\\/\\/\\s*cspell:disable-next-line.*$/",
"/[A-F0-9]{8,}/", // hex IDs, hashes
"/\\|[^\\n]*\\|/" // Cucumber tables: ignore anything between pipes
],
"files": ["**/*.{ts,tsx,js,jsx,json,md,html,css,scss,feature}", "cypress/**/*"],
"flagWords": ["teh", "adn"]
"files": [
"**/*.{ts,tsx,js,jsx,json,md,html,css,scss,feature}",
"cypress/**/*"
],
"flagWords": [
"teh",
"adn"
]
}
4 changes: 2 additions & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ export default defineConfig({
reporterEnabled:
'cypress-mochawesome-reporter, mocha-junit-reporter, @hmcts/zephyr-automation-nodejs/cypress/ZephyrReporter',
mochaJunitReporterReporterOptions: {
mochaFile: `functional-output/prod/${resolvedBrowserToRun}/component/component-test-output-[hash].xml`,
mochaFile: `functional-output/component/${resolvedBrowserToRun}/junit/component-test-output-[hash].xml`,
toConsole: false,
},
cypressMochawesomeReporterReporterOptions: {
reportDir: `functional-output/component-report/${resolvedBrowserToRun}`,
reportDir: `functional-output/component/${resolvedBrowserToRun}/json`,
overwrite: false,
html: false,
json: true,
Expand Down
Loading
Loading