@hmcts/media-viewer 4.2.26-nodejs-healthcheck-update → 4.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/cache/moment-timezone-npm-0.6.3-b95bcae468-55ae516386.zip +0 -0
- package/.yarn/cache/socket.io-parser-npm-4.2.7-0fe17183fd-da1920b9da.zip +0 -0
- package/.yarn/cache/{ws-npm-8.21.0-7629fe02dd-0884119564.zip → ws-npm-8.21.1-15d3d5537c-8493bc5430.zip} +0 -0
- package/.yarn/install-state.gz +0 -0
- package/README.md +51 -15
- package/fesm2022/hmcts-media-viewer.mjs +253 -253
- package/package.json +1 -1
- package/package.tgz +0 -0
- package/.yarn/cache/moment-timezone-npm-0.6.2-02e2e0d223-021f908742.zip +0 -0
- package/.yarn/cache/socket.io-parser-npm-4.2.6-35d9c58722-cf8f3e9fee.zip +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/README.md
CHANGED
|
@@ -81,6 +81,15 @@ This command:
|
|
|
81
81
|
- starts the local API on `PORT` or `1337`
|
|
82
82
|
- starts Angular with `proxy.config.js`
|
|
83
83
|
|
|
84
|
+
When Angular is already running and only the local API needs restarting, use:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
yarn start:api:aat
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Do not use `yarn start:api` directly for an AAT-backed run. It deliberately has no
|
|
91
|
+
environment bootstrap and will otherwise target the non-AAT local proxy defaults.
|
|
92
|
+
|
|
84
93
|
Open:
|
|
85
94
|
|
|
86
95
|
```
|
|
@@ -122,7 +131,13 @@ Current Playwright lanes:
|
|
|
122
131
|
|
|
123
132
|
| Lane | Config/project | Command | Scope |
|
|
124
133
|
| --- | --- | --- | --- |
|
|
125
|
-
| Standalone smoke | `playwright.config.ts`, project `smoke` | `yarn test:playwright:smoke` or `yarn test:smoke` |
|
|
134
|
+
| Standalone smoke | `playwright.config.ts`, project `smoke` | `yarn test:playwright:smoke` or `yarn test:smoke` | Loads standalone PDF and image fixtures and verifies rendered-document readiness, PDF zoom and navigation, image rotation and deterministic PDF search. |
|
|
135
|
+
| Viewer support | `playwright.config.ts`, project `support` | `yarn test:playwright:support` | Proves the reusable PDF, image and unsupported-media fixtures, component objects and response diagnostics. |
|
|
136
|
+
|
|
137
|
+
The Playwright config runs tests fully in parallel with seven workers. Each test
|
|
138
|
+
gets its own browser context and page-scoped route mocks. Tests must not depend
|
|
139
|
+
on execution order or share mutable documents; mutation-heavy AAT journeys must
|
|
140
|
+
provision a document per test or reset it before reuse.
|
|
126
141
|
|
|
127
142
|
Install Chromium once before local runs when the browser cache is empty:
|
|
128
143
|
|
|
@@ -148,27 +163,41 @@ Override the smoke document and case id with `MV_SMOKE_PDF_DOCUMENT_URL` and
|
|
|
148
163
|
CNP uses the same smoke entrypoint style as MC/MO. The previous CodeceptJS smoke
|
|
149
164
|
remains available as `yarn test:smoke:legacy` while migration work continues.
|
|
150
165
|
|
|
151
|
-
|
|
166
|
+
The lane wrapper commands write Playwright evidence under `functional-output/tests`:
|
|
167
|
+
|
|
168
|
+
| Lane | Odhín | JUnit | Trace, screenshot and video output |
|
|
169
|
+
| --- | --- | --- | --- |
|
|
170
|
+
| Viewer support | `functional-output/tests/playwright-support/odhin-report/xui-playwright-support.html` | `functional-output/tests/playwright-support/playwright-support-junit.xml` | `functional-output/tests/playwright-support/test-results` |
|
|
171
|
+
| Smoke | `functional-output/tests/playwright-smoke/odhin-report/xui-playwright-smoke.html` | `functional-output/tests/playwright-smoke/playwright-smoke-junit.xml` | `functional-output/tests/playwright-smoke/test-results` |
|
|
152
172
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
173
|
+
Those are the default lane-specific paths. CNP keeps preview and AAT viewer
|
|
174
|
+
support evidence separate under `functional-output/tests/playwright-support/preview`
|
|
175
|
+
and `functional-output/tests/playwright-support/aat`. Smoke evidence remains under
|
|
176
|
+
`functional-output/tests/playwright-smoke/preview` and
|
|
177
|
+
`functional-output/tests/playwright-smoke/aat`.
|
|
156
178
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
`functional-output/tests/playwright-smoke/aat` so results cannot be reused
|
|
160
|
-
across environments.
|
|
179
|
+
The raw aggregate `npx playwright test --config=playwright.config.ts` command
|
|
180
|
+
uses `functional-output/tests/playwright` unless the report paths are overridden.
|
|
161
181
|
|
|
162
182
|
Reporting behavior follows the MC/MO pattern:
|
|
163
183
|
|
|
164
184
|
- Odhín is produced through the patched `odhin-reports-playwright` reporter.
|
|
185
|
+
- Each successfully generated Odhín report uses a stable suite title and includes the application
|
|
186
|
+
version, branch, target environment, CI or local context, worker count, CPU
|
|
187
|
+
count and total RAM in its run information.
|
|
165
188
|
- CI logs Odhín finalisation progress using the same progress reporter as MC/MO.
|
|
166
|
-
-
|
|
167
|
-
|
|
189
|
+
- Odhín is the only standard human-readable report. JUnit is retained for
|
|
190
|
+
Jenkins ingestion. Screenshots and videos are kept on failure; traces are
|
|
191
|
+
captured on the first retry.
|
|
192
|
+
The standard Playwright HTML reporter is not supported.
|
|
168
193
|
- `PLAYWRIGHT_SKIP_INSTALL=true` skips browser installation when Jenkins or a
|
|
169
194
|
local setup step has already installed Chromium.
|
|
170
195
|
- Jenkins CNP and nightly pipelines publish the Odhín HTML reports, publish
|
|
171
196
|
JUnit XML, and archive the full Playwright output folders.
|
|
197
|
+
- The classic Jenkins build page exposes viewer-support reports as `PREVIEW
|
|
198
|
+
Playwright Viewer Support Test`, `AAT Playwright Viewer Support Test`, or
|
|
199
|
+
`Nightly Playwright Viewer Support Test`. Blue Ocean does not reliably show
|
|
200
|
+
HTML Publisher links.
|
|
172
201
|
|
|
173
202
|
The Jenkins `YarnBuilder` performs its immutable dependency install before the
|
|
174
203
|
first setup task. The pipeline then installs Puppeteer Chrome once for legacy
|
|
@@ -177,14 +206,19 @@ tests and Chromium into the workspace-local `PLAYWRIGHT_BROWSERS_PATH`, and sets
|
|
|
177
206
|
|
|
178
207
|
Useful overrides:
|
|
179
208
|
- `PLAYWRIGHT_BASE_URL` or `TEST_URL`: target application URL, default `http://localhost:3000/`
|
|
180
|
-
- `PLAYWRIGHT_REPORTERS`: comma-separated reporter list, for example `list,
|
|
209
|
+
- `PLAYWRIGHT_REPORTERS`: comma-separated reporter list, for example `list,junit,odhin`
|
|
181
210
|
- `PLAYWRIGHT_DEFAULT_REPORTER`: terminal reporter when `PLAYWRIGHT_REPORTERS` is not set, default `list` locally and `dot` in CI
|
|
182
|
-
- `PLAYWRIGHT_HTML_REPORT`: HTML report folder
|
|
183
211
|
- `PLAYWRIGHT_JUNIT_OUTPUT`: JUnit XML path
|
|
184
212
|
- `PLAYWRIGHT_REPORT_FOLDER`: Odhín report folder
|
|
185
213
|
- `PLAYWRIGHT_REPORT_INDEX_FILENAME`: Odhín report file name
|
|
186
214
|
- `PLAYWRIGHT_REPORT_TITLE`: Odhín report title
|
|
215
|
+
- `PLAYWRIGHT_REPORT_PROJECT`: Odhín project label
|
|
216
|
+
- `PLAYWRIGHT_REPORT_RELEASE`: Odhín release label, default `<version> | branch=<branch>`
|
|
217
|
+
- `PLAYWRIGHT_REPORT_BRANCH`: branch override used by the default release label
|
|
218
|
+
- `PLAYWRIGHT_REPORT_TEST_ENVIRONMENT` or `PW_ODHIN_ENV`: complete Odhín test-environment label override
|
|
219
|
+
- `TEST_TYPE`: target-environment label, otherwise inferred from the test URL
|
|
187
220
|
- `PLAYWRIGHT_TEST_OUTPUT_DIR`: traces, screenshots and videos folder
|
|
221
|
+
- `FUNCTIONAL_TESTS_WORKERS`: worker-count override from `1` to `64`, default `7`
|
|
188
222
|
- `PLAYWRIGHT_SKIP_INSTALL=true`: skip the automatic Chromium install in Playwright scripts
|
|
189
223
|
|
|
190
224
|
Use this local proof set before pushing Playwright documentation or pipeline
|
|
@@ -194,6 +228,7 @@ changes:
|
|
|
194
228
|
yarn install --immutable
|
|
195
229
|
yarn test:setup:playwright-install-chromium
|
|
196
230
|
PLAYWRIGHT_SKIP_INSTALL=true yarn test:playwright:smoke:list
|
|
231
|
+
PLAYWRIGHT_SKIP_INSTALL=true npx playwright test --config=playwright.config.ts
|
|
197
232
|
```
|
|
198
233
|
|
|
199
234
|
For a smoke behavior proof, start the app in one terminal:
|
|
@@ -216,13 +251,14 @@ Migration boundaries:
|
|
|
216
251
|
- Keep legacy Protractor and CodeceptJS coverage until replacement coverage and
|
|
217
252
|
Jenkins evidence are agreed.
|
|
218
253
|
- Add stable report output paths for every new Playwright lane so Jenkins can
|
|
219
|
-
publish Odhín
|
|
254
|
+
publish Odhín and JUnit and archive failure diagnostics without bespoke stage
|
|
255
|
+
logic.
|
|
220
256
|
- Prefer Playwright browser-level assertions for viewer readiness; do not treat
|
|
221
257
|
an error page, blank page, wrong route or service-down page as a valid ready
|
|
222
258
|
signal.
|
|
223
259
|
|
|
224
260
|
### 6. Create isolated AAT test documents
|
|
225
|
-
For mutation-heavy functional tests, do not share one document across parallel
|
|
261
|
+
For mutation-heavy functional tests, do not share one document across parallel tests.
|
|
226
262
|
Create fresh AAT DM Store documents through the local API proxy while `yarn start:aat`
|
|
227
263
|
is running:
|
|
228
264
|
|