Repository navigation
Add Playwright end-to-end tests and screenshots for workflow-canvas - #78
Merged
Merged
Conversation
10 tasks done
knihit
marked this pull request as ready for review
October 24, 2026 04:36
knihit
requested review from
georgebearden,
ihmaws,
shsenior and
simonkrol
as code owners
October 24, 2026 04:36
knihit
force-pushed
the
wc/02-e2e
branch
3 times, most recently
from
October 24, 2026 18:12
4bb7972 to
0b18db0
Compare
7 of 11 tasks
Contributor
Author
|
Kept the byte-exact screenshot check on purpose: it catches real rendering drift. Added a README note: after a Playwright, Chromium, font or Node bump, run |
ihmaws
previously approved these changes
Oct 27, 2026
Base automatically changed from
wc/01-scaffold
to
integration/workflow-canvas
October 27, 2026 19:34
Screenshots are written only by `npm run screenshots`, which now uses its own Playwright config. The default config, a bare `npx playwright test` and editor integrations run the functional suite only, so they cannot rewrite committed files. The capture pins the Open Sans font from a dev dependency (Cloudscape names it first but does not ship it) and turns off text hinting and LCD smoothing, so the PNGs are byte-identical across machines. Regenerated the two screenshots with it. ESLint now uses type information for e2e/ and enables @typescript-eslint/no-floating-promises and the Playwright rules, so a missing await or a fixed wait fails lint. Tab tests: select Execution and then Designer and assert both tab states, through a shared expectTabShown helper, so switching back to Designer is actually tested. CI: the report upload warns and the screenshot upload fails when no files are found. Retries are off so a flaky test fails the run.
CI regenerated the screenshots but never compared them with the committed files. It now fails when they differ, with a message that says how to fix it. Also move retries: 0 into the shared Playwright config so the screenshot capture has it too, note in the README that a running preview server on port 4173 makes the run fail, and document the TabName type.
knihit
dismissed
ihmaws’s stale review
October 27, 2026 19:34
The merge-base changed after approval.
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.
Description
workflow-canvas/ end-to-end tests:
@playwright/test1.64.1 and@axe-core/playwright4.14.0, exact-pinned, to the existingpackage.json(no new package) — runs the UI in a real browser, which the jsdom unit tests cannot.playwright.config.ts(the functional suite),playwright.screenshots.config.ts(the screenshot capture) andplaywright.shared.ts(what they share): Chromium only, 1280x800 viewport, light color scheme, reduced motion, fixed locale and time zone. They build the app and serve it withvite previewthroughwebServer, so tests run against the production bundle.webServeris a list, so the stub API planned for a later PR gets its own entry there. Retries are off in the shared config, so a flaky test fails the run and the screenshot capture has the same setting.e2e/tests/: the page loads with the "Workflow canvas"h1inside themainlandmark, Designer is selected first, Designer to Execution and back asserts both tab states and panels, and axe reports no violations on either tab. I checked the axe helper can fail by running it on a page with known problems.e2e/support/: aWorkflowCanvasPagepage object with anexpectTabShownassertion helper, atestfixture that opens the app, and the axe and screenshot helpers — so later PRs add tests without repeating selectors.npm run test:e2e(functional tests) andnpm run screenshots(rewrites the PNGs). The capture has its own Playwright config, sonpm run test:e2e, a barenpx playwright testand editor integrations never touch committed files; I ran the last two andgit statusstayed clean.e2e/screenshots/designer-tab.pngandexecution-tab.png, full page, light theme (shown below). The capture loads Open Sans from the exact-pinned@fontsource-variable/open-sansdev dependency (Cloudscape names it first in its font stack but does not ship it) and turns off text hinting and LCD smoothing, so the files are byte-identical across runs and machines (checked between this machine, the Playwright Docker image and the CI artifact, which has the same SHA-256 as the committed files).typechecknow also checkse2e/and the Playwright configs. ESLint applies the same strict rules toe2e/, with type information,@typescript-eslint/no-floating-promisesandeslint-plugin-playwright(exact-pinned), so a missingawaitor a fixedwaitForTimeoutfails lint. I checked both fail on a throwaway spec.CI:
.github/workflows/workflow-canvas.yml: added ane2ejob on Node 24 that installs Chromium with system dependencies, runstest:e2e, regenerates the screenshots, fails if they differ from the committed files (git diff --exit-code, with a message that says to runnpm run screenshots), and uploads the HTML report and the screenshots as artifacts whether the run passes or fails. The report upload warns and the screenshot upload fails when no files are found. Permissions staycontents: read;actions/upload-artifactv7.0.2 is pinned by SHA like the other actions. The existing lint/typecheck/test/build job is unchanged.Docs:
workflow-canvas/README.md: how to install the browser, run the tests, read the report and regenerate screenshots, and that avite previewleft running on port 4173 makes the run fail.CHANGELOG.md: entry under Unreleased.VERSIONis not bumped.Screenshots
Designer tab:
Execution tab:
Type of Change
package.json,Cargo.toml, or CLI dependency)workflow-canvas/Testing
npm testpasses (runstests/scripts/**/*.test.js). Not rerun for this PR: it changes nothing outsideworkflow-canvas/,CHANGELOG.mdand the workflow-canvas workflow.workflow-canvas/:npm run lint,npm run typecheck,npm test(3 unit tests),npm run buildandnpm run test:e2e(5 tests; 3 runs of 10 repeats each, 4 workers, 0 failures) pass locally on Node 24Checklist
Notes for Reviewers
integration/workflow-canvas<- Add workflow-canvas scaffold: Vite, React, Cloudscape, CI #77 (wc/01-scaffold) <- this PR. Base iswc/01-scaffold; GitHub retargets it as Add workflow-canvas scaffold: Vite, React, Cloudscape, CI #77 merges.package-lock.jsonaccounts for 114 of the added lines; the rest is about 435 lines.