Repository navigation
test(e2e): add browser tests for the bundled vis-network library - #120
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #119 (base branch
deps/vis-network-10); GitHub retargets it tomainonce #119 is merged.The unit tests run against
visstubs 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
package.json.#knowledgegraphrenders 3 nodes and 3 edges on a canvas, without console or page errors.getNodeAt).hoverEdge/blurEdge).oncontext).doubleClick).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 bybuild/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
Network#ondisabled in the served bundle, the hit-test, hover, context-menu and double-click tests fail.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.