Test page objects cleaned up, 20 violations resolved
Playwright test suite gets a tidy-up with scoped locators, navigation methods, and dead code removal.
The Playwright end-to-end test suite has been cleaned up, resolving 20 janitor violations related to locator scoping and dead code. Seven modal page objects now use a consistent container() getter pattern instead of getModal() methods, ensuring all child locators are properly scoped within their parent containers. This approach aligns with Playwright best practices and should reduce test flakiness caused by selector collisions.
Thirteen top-level page objects gained goto() navigation methods, making tests easier to write and more readable. Previously, navigation logic was scattered across individual tests; now it lives where it belongs—on the page objects themselves.
Dead code was also pruned: an unused dispatchPushEvent() method was removed from DemoPage. The janitor baseline dropped from 516 to 496 violations, with typecheck and lint passing cleanly.
These changes live entirely in the @n8n/testing package's Playwright test infrastructure.
View Original GitHub DescriptionFact Check
Summary
- Resolves 20 janitor violations (scope-lockdown + dead-code), reducing baseline from 516 → 496
- Converts 7 modal page objects to use
get container()pattern with properly scoped locators (MfaSetupModal, WorkflowCredentialSetupModal, NpsSurveyPage, WorkflowSharingModal, SourceControlPullModal, SourceControlPushModal, VersionsPage) - Adds
goto()navigation methods to 13 top-level page objects (CanvasPage, ChatHub pages, CredentialsPage, DataTable pages, ExecutionsPage, ProjectSettingsPage, TemplateCredentialSetupPage, WorkflowsPage) - Removes dead code: unused
dispatchPushEvent()from DemoPage - Updates all test files and composables referencing renamed methods
Test plan
-
pnpm --filter=n8n-playwright typecheckpasses -
pnpm --filter=n8n-playwright lintpasses -
pnpm janitorreports 0 new violations against updated baseline - CI pipeline passes
🤖 Generated with Claude Code