bimplus-renderer 1.8.39 → 1.8.40-webifc1.0
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/README.md +70 -1
- package/dist/bimplus-renderer.js +1 -1
- package/package.json +31 -23
- package/playwright.config.mjs +71 -0
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ goto your application folder which uses the renderer
|
|
|
79
79
|
npm install
|
|
80
80
|
|
|
81
81
|
### Unit testing
|
|
82
|
-
Run tests from the renderer root. Vitest
|
|
82
|
+
Run tests from the renderer root. Vitest runs the unit and geometry DDT suites; the
|
|
83
83
|
test files import Vitest APIs directly. Browser globals, fixtures, and
|
|
84
84
|
test-only dependencies are initialized in `test/setup/vitestBrowser.setup.js`.
|
|
85
85
|
|
|
@@ -144,6 +144,75 @@ npm run test-vitest-modelviewer-chrome
|
|
|
144
144
|
npm run test-vitest-modelviewer-chrome-long
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
+
### Modelviewer image comparison (Playwright Test)
|
|
148
|
+
|
|
149
|
+
The standalone Playwright suite loads each IFC into the real renderer, checks
|
|
150
|
+
viewport diagnostics, fits a fixed perspective view without camera animation,
|
|
151
|
+
and compares the 1000 x 700 viewport against a PNG baseline. It uses the same
|
|
152
|
+
Vite shader/asset configuration and viewer helpers as the geometry DDT, without
|
|
153
|
+
reading or changing `Results.db` or requiring the DDT server.
|
|
154
|
+
|
|
155
|
+
```sh
|
|
156
|
+
npx playwright install firefox chromium
|
|
157
|
+
npm run test-modelviewer-ddt-visual
|
|
158
|
+
npm run test-modelviewer-ddt-visual-long
|
|
159
|
+
npx playwright test --project=chromium
|
|
160
|
+
npx playwright test --project=chromium-long
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The IFC datasets must be present locally (use `sync-modelviewer-ddt` or
|
|
164
|
+
`sync-modelviewer-ddt-long` if needed). Only the selected dataset is required.
|
|
165
|
+
To run only one model, use Playwright's title filter:
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
npm run test-modelviewer-ddt-visual -- --grep "BasicProject.ifc"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Missing baselines fail normal runs. To create only missing baselines without
|
|
172
|
+
replacing existing images:
|
|
173
|
+
|
|
174
|
+
```sh
|
|
175
|
+
npm run test-modelviewer-ddt-visual-init
|
|
176
|
+
npm run test-modelviewer-ddt-visual-long-init
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
To explicitly replace baselines after reviewing an intentional rendering change:
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
npm run test-modelviewer-ddt-visual -- --update-snapshots
|
|
183
|
+
npm run test-modelviewer-ddt-visual-long -- --update-snapshots
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Review the images before committing them under
|
|
187
|
+
`modelviewer-data-driven-tests/playwright/snapshots/`. Baselines are separated
|
|
188
|
+
by browser, dataset, and OS; generate and compare using the same OS and GPU
|
|
189
|
+
environment. The included Windows Firefox baselines cover both datasets;
|
|
190
|
+
other browser/OS combinations need their own initial baseline generation.
|
|
191
|
+
The per-test timeout is 100 minutes and includes IFC loading; the separate
|
|
192
|
+
15-second screenshot timeout starts only after loading and camera setup finish.
|
|
193
|
+
An `A snapshot doesn't exist` error means a baseline is missing, not that
|
|
194
|
+
loading timed out. Use the initialization command above in that case.
|
|
195
|
+
Comparisons allow a per-pixel color
|
|
196
|
+
threshold of 0.2 but no differing pixels above that threshold. Playwright waits for consecutive stable
|
|
197
|
+
screenshots rather than using a fixed sleep. Failures produce expected, actual,
|
|
198
|
+
and diff images under `test-results/modelviewer-visual/`; the HTML report is
|
|
199
|
+
in `playwright-report/`, with JUnit output in
|
|
200
|
+
`test-results/playwright-modelviewer-visual.xml`.
|
|
201
|
+
|
|
202
|
+
The HTML reporter uses hashed filenames internally. Actual comparison images
|
|
203
|
+
from failed comparisons are also copied directly to
|
|
204
|
+
`playwright-report/data/named/`, using the baseline filename without the
|
|
205
|
+
`-actual` suffix, for example `BasicProject-ifc.png`.
|
|
206
|
+
The filename comes from the matching baseline, preserving the full name even
|
|
207
|
+
when Playwright shortens the failure artifact's filename with a hash.
|
|
208
|
+
There are no subfolders, expected images, diff images, or full-page failure
|
|
209
|
+
screenshots in this folder.
|
|
210
|
+
If multiple browsers, repeats, or retries produce the same filename, the last
|
|
211
|
+
result in report order replaces the earlier copy; run one browser at a time
|
|
212
|
+
to keep its images separate. The internal hashed files are retained so the
|
|
213
|
+
HTML report's image viewer continues to work, including expected and diff
|
|
214
|
+
images. Both sets of report images are regenerated on each run.
|
|
215
|
+
|
|
147
216
|
Vitest writes JUnit output under `test-results/`. Firefox Istanbul coverage is
|
|
148
217
|
written under `coverage/`, including `coverage/lcov.info` for CI artifact
|
|
149
218
|
collection. Coverage instruments renderer source under `src/`, excluding
|