Janitor violations cleaned up in Playwright page objects
Test code enforcement tightens as 32 lint violations are resolved across NodeDetailsView and Project composables, with locators now properly scoped to containers rather than the global page object.
The Playwright test suite is getting cleaner as 32 janitor violations are resolved across three files. The janitor tool enforces rules that keep test locators properly scoped and discourage direct page access in composables.
In NodeDetailsViewPage, locators were updated from this.page to this.getContainer() so elements are found within the NDV container rather than globally on the page. In NodeDetailsViewComposer and ProjectComposer, direct calls to this.n8n.page.getByTestId() were replaced with calls to page object methods like ndv.getResourceLocatorItems() and sideBar.universalAdd().
These changes ensure tests interact with the correct elements in isolation, reducing flakiness when multiple components share similar test IDs. The baseline was updated to reflect 408 remaining violations across the codebase.
In the testing package's Playwright infrastructure.
View Original GitHub DescriptionFact Check
Summary
- Fix 27 scope-lockdown violations in
NodeDetailsViewPageby replacing unscopedthis.pagewiththis.getContainer()for locators inside the NDV container - Fix 7 selector-purity violations in
NodeDetailsViewComposerby using page object methods instead of directpage.getByTestId()calls - Fix 11 selector-purity + no-page-in-flow violations in
ProjectComposerby using sidebar page object methods - Update janitor baseline from 440 → 395 violations
Test plan
-
pnpm typecheckpasses -
pnpm lintpasses -
pnpm janitorreports zero new violations against updated baseline
🤖 Generated with Claude Code