test: audit and clean up Playwright E2E suite#306
Merged
tomasz-tomczyk merged 1 commit intomainfrom Apr 18, 2026
Merged
Conversation
- Remove redundant file tree tests from loading.spec.ts (already covered by file-tree.spec.ts) - Fix `any` types in templates.spec.ts helpers to use proper `Page` type from Playwright - Replace bare `setTimeout(1500)` in rendered-diff.filemode.spec.ts with a polling loop that waits for the file watcher to detect edits before triggering round-complete - Fix misleading comment on tautological assertion in rendered-diff.filemode.spec.ts
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.
Summary
Audited all 60 Playwright E2E spec files across 5 projects (git-mode, file-mode, single-file, no-git, multi-file). Found and fixed:
loading.spec.tsthat duplicatedfile-tree.spec.tscoverage (same assertions, same fixture)setTimeout(1500)inrendered-diff.filemode.spec.tswith a polling loop that waits for the file watcher to detect edits before triggering round-complete — follows the documented exception pattern (sleep inside retry loop)anytypes intemplates.spec.tshelper functions to use properPagetype from Playwright>= 0) inrendered-diff.filemode.spec.tsto accurately describe why the assertion is weakWhat the audit found was already good
The suite is generally well-structured. Most files properly use
clearAllCommentsinbeforeEach, import from./helpers, follow naming conventions, and use Playwright auto-retrying assertions. ThetoPass()wrapper is correctly used where snapshot counts are needed inside retry loops. No truly dead tests were found.Notable observations (not actionable in this PR)
accessibility.spec.tsdark theme contrast test has awaitForTimeout(100)that is pragmatically necessary for axe-core CSS propagation — no clean replacement existssettings-panel.filemode.spec.tsandtheme.filemode.spec.tsare near-duplicates of their git-mode counterparts, but they exercise different server fixtures so removing them would reduce coverage.count()+expect(count).toBeGreaterThan(N)patterns exist but are preceded bytoBeVisible()assertions that stabilize the DOM, making them low-riskTest plan
make e2e) — 554 tests across 5 projects