@hmcts/media-viewer 4.2.26-minimist-update → 4.2.26-nodejs-healthcheck-update-01

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.
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
  ```
@@ -112,8 +121,142 @@ This opens `http://localhost:3000/#/media-viewer`, loads
112
121
  and first page. If `MV_SMOKE_PDF_DOCUMENT_ID` is blank, the smoke uses the demo app's
113
122
  default AAT PDF document id.
114
123
 
115
- ### 5. Create isolated AAT test documents
116
- For mutation-heavy functional tests, do not share one document across parallel workers.
124
+ ### 5. Run Playwright tests
125
+ Media Viewer is starting its Playwright migration with the same runner and
126
+ reporting shape used in MC and MO, scaled to the current smoke coverage. The
127
+ legacy Protractor and CodeceptJS functional packs still exist; new browser
128
+ coverage should be added under `playwright_tests/`.
129
+
130
+ Current Playwright lanes:
131
+
132
+ | Lane | Config/project | Command | Scope |
133
+ | --- | --- | --- | --- |
134
+ | Standalone smoke | `playwright.config.ts`, project `smoke` | `yarn test:playwright:smoke` or `yarn test:smoke` | Opens the standalone Media Viewer demo, loads `assets/example.pdf`, and verifies the PDF viewer, page-number control and first rendered page. |
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.
141
+
142
+ Install Chromium once before local runs when the browser cache is empty:
143
+
144
+ ```
145
+ yarn test:setup:playwright-install-chromium
146
+ ```
147
+
148
+ Run the smoke project against a running standalone demo app. Start the app in
149
+ one terminal:
150
+
151
+ ```
152
+ yarn start
153
+ ```
154
+
155
+ Then run the smoke in another terminal:
156
+
157
+ ```
158
+ yarn test:playwright:smoke
159
+ ```
160
+
161
+ Override the smoke document and case id with `MV_SMOKE_PDF_DOCUMENT_URL` and
162
+ `MV_SMOKE_CASE_ID`. `yarn test:smoke` now runs the Playwright smoke so Jenkins
163
+ CNP uses the same smoke entrypoint style as MC/MO. The previous CodeceptJS smoke
164
+ remains available as `yarn test:smoke:legacy` while migration work continues.
165
+
166
+ The lane wrapper commands write Playwright evidence under `functional-output/tests`:
167
+
168
+ | Lane | Odhín | HTML | 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/html-report/index.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/html-report/index.html` | `functional-output/tests/playwright-smoke/playwright-smoke-junit.xml` | `functional-output/tests/playwright-smoke/test-results` |
172
+
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`.
178
+
179
+ The raw aggregate `npx playwright test --config=playwright.config.ts` command
180
+ uses `functional-output/tests/playwright` unless the report paths are overridden.
181
+
182
+ Reporting behavior follows the MC/MO pattern:
183
+
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.
188
+ - CI logs Odhín finalisation progress using the same progress reporter as MC/MO.
189
+ - HTML, JUnit and Odhín reporters can run together.
190
+ - Traces, screenshots and videos are kept on failure for diagnostics.
191
+ - `PLAYWRIGHT_SKIP_INSTALL=true` skips browser installation when Jenkins or a
192
+ local setup step has already installed Chromium.
193
+ - Jenkins CNP and nightly pipelines publish the Odhín HTML reports, publish
194
+ JUnit XML, and archive the full Playwright output folders.
195
+ - The classic Jenkins build page exposes viewer-support reports as `PREVIEW
196
+ Playwright Viewer Support Test`, `AAT Playwright Viewer Support Test`, or
197
+ `Nightly Playwright Viewer Support Test`. Blue Ocean does not reliably show
198
+ HTML Publisher links.
199
+
200
+ The Jenkins `YarnBuilder` performs its immutable dependency install before the
201
+ first setup task. The pipeline then installs Puppeteer Chrome once for legacy
202
+ tests and Chromium into the workspace-local `PLAYWRIGHT_BROWSERS_PATH`, and sets
203
+ `PLAYWRIGHT_SKIP_INSTALL=true` so Playwright lanes do not reinstall it.
204
+
205
+ Useful overrides:
206
+ - `PLAYWRIGHT_BASE_URL` or `TEST_URL`: target application URL, default `http://localhost:3000/`
207
+ - `PLAYWRIGHT_REPORTERS`: comma-separated reporter list, for example `list,html,junit,odhin`
208
+ - `PLAYWRIGHT_DEFAULT_REPORTER`: terminal reporter when `PLAYWRIGHT_REPORTERS` is not set, default `list` locally and `dot` in CI
209
+ - `PLAYWRIGHT_HTML_REPORT`: HTML report folder
210
+ - `PLAYWRIGHT_JUNIT_OUTPUT`: JUnit XML path
211
+ - `PLAYWRIGHT_REPORT_FOLDER`: Odhín report folder
212
+ - `PLAYWRIGHT_REPORT_INDEX_FILENAME`: Odhín report file name
213
+ - `PLAYWRIGHT_REPORT_TITLE`: Odhín report title
214
+ - `PLAYWRIGHT_REPORT_PROJECT`: Odhín project label
215
+ - `PLAYWRIGHT_REPORT_RELEASE`: Odhín release label, default `<version> | branch=<branch>`
216
+ - `PLAYWRIGHT_REPORT_BRANCH`: branch override used by the default release label
217
+ - `PLAYWRIGHT_REPORT_TEST_ENVIRONMENT` or `PW_ODHIN_ENV`: complete Odhín test-environment label override
218
+ - `TEST_TYPE`: target-environment label, otherwise inferred from the test URL
219
+ - `PLAYWRIGHT_TEST_OUTPUT_DIR`: traces, screenshots and videos folder
220
+ - `FUNCTIONAL_TESTS_WORKERS`: worker-count override from `1` to `64`, default `7`
221
+ - `PLAYWRIGHT_SKIP_INSTALL=true`: skip the automatic Chromium install in Playwright scripts
222
+
223
+ Use this local proof set before pushing Playwright documentation or pipeline
224
+ changes:
225
+
226
+ ```
227
+ yarn install --immutable
228
+ yarn test:setup:playwright-install-chromium
229
+ PLAYWRIGHT_SKIP_INSTALL=true yarn test:playwright:smoke:list
230
+ PLAYWRIGHT_SKIP_INSTALL=true npx playwright test --config=playwright.config.ts
231
+ ```
232
+
233
+ For a smoke behavior proof, start the app in one terminal:
234
+
235
+ ```
236
+ yarn start
237
+ ```
238
+
239
+ Then run the Playwright smoke in another terminal:
240
+
241
+ ```
242
+ PLAYWRIGHT_SKIP_INSTALL=true yarn test:smoke
243
+ ```
244
+
245
+ Migration boundaries:
246
+
247
+ - Put new native Playwright specs under `playwright_tests/`.
248
+ - Keep screen interactions and reusable locators in page objects under
249
+ `playwright_tests/pages/`; keep assertions visible in specs.
250
+ - Keep legacy Protractor and CodeceptJS coverage until replacement coverage and
251
+ Jenkins evidence are agreed.
252
+ - Add stable report output paths for every new Playwright lane so Jenkins can
253
+ publish Odhín, HTML and JUnit without bespoke stage logic.
254
+ - Prefer Playwright browser-level assertions for viewer readiness; do not treat
255
+ an error page, blank page, wrong route or service-down page as a valid ready
256
+ signal.
257
+
258
+ ### 6. Create isolated AAT test documents
259
+ For mutation-heavy functional tests, do not share one document across parallel tests.
117
260
  Create fresh AAT DM Store documents through the local API proxy while `yarn start:aat`
118
261
  is running:
119
262
 
@@ -130,7 +273,7 @@ This writes:
130
273
  The upload path mirrors em-showcase: multipart `files`, `classification=PUBLIC`,
131
274
  and civil/probate metadata are posted to `/documents`.
132
275
 
133
- ### 6. Run isolated local functional tests
276
+ ### 7. Run isolated local functional tests
134
277
  With `yarn start:aat` still running, execute the functional groups with separate
135
278
  documents and separate reports:
136
279
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmcts/media-viewer",
3
- "version": "4.2.26-minimist-update",
3
+ "version": "4.2.26-nodejs-healthcheck-update-01",
4
4
  "description": "Media Viewer",
5
5
  "keywords": [
6
6
  "Angular",
package/package.tgz CHANGED
Binary file