@hmcts/media-viewer 4.2.26-minimist-update → 4.2.26-nodejs-healthcheck-update
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/install-state.gz +0 -0
- package/README.md +111 -2
- package/package.json +1 -1
- package/package.tgz +0 -0
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/README.md
CHANGED
|
@@ -112,7 +112,116 @@ This opens `http://localhost:3000/#/media-viewer`, loads
|
|
|
112
112
|
and first page. If `MV_SMOKE_PDF_DOCUMENT_ID` is blank, the smoke uses the demo app's
|
|
113
113
|
default AAT PDF document id.
|
|
114
114
|
|
|
115
|
-
### 5.
|
|
115
|
+
### 5. Run Playwright tests
|
|
116
|
+
Media Viewer is starting its Playwright migration with the same runner and
|
|
117
|
+
reporting shape used in MC and MO, scaled to the current smoke coverage. The
|
|
118
|
+
legacy Protractor and CodeceptJS functional packs still exist; new browser
|
|
119
|
+
coverage should be added under `playwright_tests/`.
|
|
120
|
+
|
|
121
|
+
Current Playwright lanes:
|
|
122
|
+
|
|
123
|
+
| Lane | Config/project | Command | Scope |
|
|
124
|
+
| --- | --- | --- | --- |
|
|
125
|
+
| 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. |
|
|
126
|
+
|
|
127
|
+
Install Chromium once before local runs when the browser cache is empty:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
yarn test:setup:playwright-install-chromium
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Run the smoke project against a running standalone demo app. Start the app in
|
|
134
|
+
one terminal:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
yarn start
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Then run the smoke in another terminal:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
yarn test:playwright:smoke
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Override the smoke document and case id with `MV_SMOKE_PDF_DOCUMENT_URL` and
|
|
147
|
+
`MV_SMOKE_CASE_ID`. `yarn test:smoke` now runs the Playwright smoke so Jenkins
|
|
148
|
+
CNP uses the same smoke entrypoint style as MC/MO. The previous CodeceptJS smoke
|
|
149
|
+
remains available as `yarn test:smoke:legacy` while migration work continues.
|
|
150
|
+
|
|
151
|
+
Default Playwright evidence is written under `functional-output/tests`:
|
|
152
|
+
|
|
153
|
+
| Lane | Odhín | HTML | JUnit | Trace, screenshot and video output |
|
|
154
|
+
| --- | --- | --- | --- | --- |
|
|
155
|
+
| 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` |
|
|
156
|
+
|
|
157
|
+
Those are the default local and nightly paths. CNP keeps preview and AAT
|
|
158
|
+
evidence separate under `functional-output/tests/playwright-smoke/preview` and
|
|
159
|
+
`functional-output/tests/playwright-smoke/aat` so results cannot be reused
|
|
160
|
+
across environments.
|
|
161
|
+
|
|
162
|
+
Reporting behavior follows the MC/MO pattern:
|
|
163
|
+
|
|
164
|
+
- Odhín is produced through the patched `odhin-reports-playwright` reporter.
|
|
165
|
+
- CI logs Odhín finalisation progress using the same progress reporter as MC/MO.
|
|
166
|
+
- HTML, JUnit and Odhín reporters can run together.
|
|
167
|
+
- Traces, screenshots and videos are kept on failure for diagnostics.
|
|
168
|
+
- `PLAYWRIGHT_SKIP_INSTALL=true` skips browser installation when Jenkins or a
|
|
169
|
+
local setup step has already installed Chromium.
|
|
170
|
+
- Jenkins CNP and nightly pipelines publish the Odhín HTML reports, publish
|
|
171
|
+
JUnit XML, and archive the full Playwright output folders.
|
|
172
|
+
|
|
173
|
+
The Jenkins `YarnBuilder` performs its immutable dependency install before the
|
|
174
|
+
first setup task. The pipeline then installs Puppeteer Chrome once for legacy
|
|
175
|
+
tests and Chromium into the workspace-local `PLAYWRIGHT_BROWSERS_PATH`, and sets
|
|
176
|
+
`PLAYWRIGHT_SKIP_INSTALL=true` so Playwright lanes do not reinstall it.
|
|
177
|
+
|
|
178
|
+
Useful overrides:
|
|
179
|
+
- `PLAYWRIGHT_BASE_URL` or `TEST_URL`: target application URL, default `http://localhost:3000/`
|
|
180
|
+
- `PLAYWRIGHT_REPORTERS`: comma-separated reporter list, for example `list,html,junit,odhin`
|
|
181
|
+
- `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
|
+
- `PLAYWRIGHT_JUNIT_OUTPUT`: JUnit XML path
|
|
184
|
+
- `PLAYWRIGHT_REPORT_FOLDER`: Odhín report folder
|
|
185
|
+
- `PLAYWRIGHT_REPORT_INDEX_FILENAME`: Odhín report file name
|
|
186
|
+
- `PLAYWRIGHT_REPORT_TITLE`: Odhín report title
|
|
187
|
+
- `PLAYWRIGHT_TEST_OUTPUT_DIR`: traces, screenshots and videos folder
|
|
188
|
+
- `PLAYWRIGHT_SKIP_INSTALL=true`: skip the automatic Chromium install in Playwright scripts
|
|
189
|
+
|
|
190
|
+
Use this local proof set before pushing Playwright documentation or pipeline
|
|
191
|
+
changes:
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
yarn install --immutable
|
|
195
|
+
yarn test:setup:playwright-install-chromium
|
|
196
|
+
PLAYWRIGHT_SKIP_INSTALL=true yarn test:playwright:smoke:list
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
For a smoke behavior proof, start the app in one terminal:
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
yarn start
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Then run the Playwright smoke in another terminal:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
PLAYWRIGHT_SKIP_INSTALL=true yarn test:smoke
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Migration boundaries:
|
|
212
|
+
|
|
213
|
+
- Put new native Playwright specs under `playwright_tests/`.
|
|
214
|
+
- Keep screen interactions and reusable locators in page objects under
|
|
215
|
+
`playwright_tests/pages/`; keep assertions visible in specs.
|
|
216
|
+
- Keep legacy Protractor and CodeceptJS coverage until replacement coverage and
|
|
217
|
+
Jenkins evidence are agreed.
|
|
218
|
+
- Add stable report output paths for every new Playwright lane so Jenkins can
|
|
219
|
+
publish Odhín, HTML and JUnit without bespoke stage logic.
|
|
220
|
+
- Prefer Playwright browser-level assertions for viewer readiness; do not treat
|
|
221
|
+
an error page, blank page, wrong route or service-down page as a valid ready
|
|
222
|
+
signal.
|
|
223
|
+
|
|
224
|
+
### 6. Create isolated AAT test documents
|
|
116
225
|
For mutation-heavy functional tests, do not share one document across parallel workers.
|
|
117
226
|
Create fresh AAT DM Store documents through the local API proxy while `yarn start:aat`
|
|
118
227
|
is running:
|
|
@@ -130,7 +239,7 @@ This writes:
|
|
|
130
239
|
The upload path mirrors em-showcase: multipart `files`, `classification=PUBLIC`,
|
|
131
240
|
and civil/probate metadata are posted to `/documents`.
|
|
132
241
|
|
|
133
|
-
###
|
|
242
|
+
### 7. Run isolated local functional tests
|
|
134
243
|
With `yarn start:aat` still running, execute the functional groups with separate
|
|
135
244
|
documents and separate reports:
|
|
136
245
|
|
package/package.json
CHANGED
package/package.tgz
CHANGED
|
Binary file
|