Skip to content
Merged
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
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ jobs:
global-json-file: global.json
dotnet-version: |
8.0.x
- name: Build the viewer fixture and benchmark tools
working-directory: .
run: |
dotnet build tests/fixtures/viewer/generate-fixtures.cs -c Release
dotnet build tools/SyntheticModel/SyntheticModel.cs -c Release
- uses: actions/setup-node@v7
with:
node-version: 24
Expand All @@ -71,5 +76,5 @@ jobs:
# dist/viewer.js is committed and embedded in the library: it must match the sources.
- run: git diff --exit-code dist/
- run: npm test
- run: npx playwright install --with-deps chromium
- run: npm run e2e
- run: npx playwright install --with-deps chromium firefox
- run: xvfb-run -a npx playwright test
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ fails when it differs from the committed file. The end-to-end tests need the
.NET SDK and a Chromium for Playwright (`npx playwright install chromium`).
Fixtures are in `tests/fixtures/viewer`.

CI also runs the smoke, selection and section tests in Firefox and builds `tests/fixtures/viewer/generate-fixtures.cs`
and `tools/SyntheticModel/SyntheticModel.cs`. To run the Firefox project locally, build the viewer, install Firefox
with `npx playwright install firefox` and run `npx playwright test --project=firefox`. On Linux, install browser
system dependencies with `npx playwright install --with-deps chromium firefox` and prefix the Firefox command with
`xvfb-run -a` on machines without a display.

`npm run perf` runs the manual performance harness in a visible Chromium
window (for example `PERF_LADDER=25000,200000` measures synthetic models made
by `tools/SyntheticModel`); its settings are described at the top of
Expand Down
2 changes: 1 addition & 1 deletion src/IOViewer/Viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "esbuild src/main.js --bundle --minify --format=iife --target=es2020 --outfile=dist/viewer.js",
"test": "node --test test/unit/*.test.js",
"e2e": "npm run build && playwright test",
"e2e": "npm run build && playwright test --project=chromium",
"perf": "npm run build && playwright test --config playwright.perf.config.js"
},
"dependencies": {
Expand Down
14 changes: 13 additions & 1 deletion src/IOViewer/Viewer/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
reporter: 'list',
use: {
browserName: 'chromium',
locale: 'ru-RU',
viewport: { width: 1280, height: 800 },
},
projects: [
{ name: 'chromium', use: { browserName: 'chromium' } },
{
name: 'firefox',
testMatch: ['**/smoke.spec.js', '**/selection.spec.js', '**/sections.spec.js'],
use: {
browserName: 'firefox',
// Under Linux, Xvfb supplies the display Firefox uses to create a WebGL context in CI.
headless: process.platform !== 'linux',
launchOptions: { firefoxUserPrefs: { 'webgl.force-enabled': true } },
},
},
],
});
Loading