Skip to content

test(e2e): add browser tests for the bundled vis-network library - #120

Merged
gesinn-it-gea merged 2 commits into
mainfrom
test/vis-network-e2e
Nov 11, 2026
Merged

gesinn-it-gea merged 2 commits into
mainfrom
test/vis-network-e2e

Conversation

@gesinn-it-gea

Copy link
Copy Markdown
Member

Stacked on #119 (base branch deps/vis-network-10); GitHub retargets it to main once #119 is merged.

The unit tests run against vis stubs and the contract test in #119 only checks that the used API exists. Rendering and the events our handlers react to were never exercised. This adds Playwright tests against a running test wiki.

What is tested

  • The served vis-network version is the one pinned in package.json.
  • #knowledgegraph renders 3 nodes and 3 edges on a canvas, without console or page errors.
  • Pointer position maps to the node under it (getNodeAt).
  • Hovering an edge selects it, moving away releases it (hoverEdge / blurEdge).
  • Right click opens the node context menu (oncontext).
  • Double click opens the node's article (doubleClick).
  • A click on a node and loading the Designer cause no errors.

CI

Runs on the coverage leg only, after the coverage upload, so a failing browser test does not lose coverage data. It reuses the wiki that leg already installed instead of building another image. The CI stack publishes no port, so a build/docker-compose.override.yml (picked up by build/Makefile) publishes 8080 on that leg. The Playwright report is uploaded as an artifact on failure. The tests live in their own package (tests/e2e) so Playwright is not part of the unit test toolchain; Dependabot tracks it separately.

Verification

  • Run locally against a MediaWiki 1.43 / SMW 7.2.0 test wiki: all 8 tests pass with vis-network 9.1.13 and 10.1.4 (served version read from the ResourceLoader module).
  • With Network#on disabled in the served bundle, the hit-test, hover, context-menu and double-click tests fail.
  • 70 consecutive runs without a failure. A first version used fixed sleeps and failed 3 of 35 runs; it now waits until the node positions on screen stop changing.
  • The override file was checked with docker compose config; the new workflow steps themselves can only be verified by the CI run of this PR.

Not covered

The click test only asserts that no error occurs, and the Designer test only that the page loads. The Designer dialogs (for example "Add node") are not exercised.

Unit tests run against vis stubs and the contract test only checks that the
used API exists, so rendering and events were never exercised. Add Playwright
tests against a running test wiki: graph rendering, hit testing, edge hover
selection, node context menu, double-click and the Designer page, plus a check
that the served library version is the one pinned in package.json.

The tests wait for the layout to settle instead of sleeping, and are kept in
their own package so Playwright is not part of the unit test toolchain.
Reuse the wiki that the coverage leg already installed instead of building
another image. The CI stack publishes no port, so provide it through the
override file that build/Makefile picks up. Run the browser tests after the
coverage upload so that a failing browser test does not lose coverage data,
and keep the report as an artifact on failure. Let Dependabot track the
separate tests/e2e package.
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.68%. Comparing base (48282c3) to head (9ca8c55).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #120   +/-   ##
=========================================
  Coverage     80.68%   80.68%           
  Complexity      186      186           
=========================================
  Files            18       18           
  Lines          1807     1807           
  Branches        216      216           
=========================================
  Hits           1458     1458           
  Misses          197      197           
  Partials        152      152           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from deps/vis-network-10 to main November 11, 2026 10:44
@gesinn-it-gea gesinn-it-gea reopened this Nov 11, 2026
@gesinn-it-gea
gesinn-it-gea merged commit 4a15b15 into main Nov 11, 2026
10 checks passed
@gesinn-it-gea
gesinn-it-gea deleted the test/vis-network-e2e branch November 11, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant