Add Playwright e2e tests for web public navigation#16
Open
Ziinc wants to merge 5 commits into
Open
Conversation
Sets up @playwright/test in web/, builds the Docusaurus site, and serves it on a background dev server before running tests. Covers navbar (Guides, Reference, Get Started, logo, GitHub link), sidebar navigation within both the Guides and Reference sections, cross- section switching, and footer links. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015mYEP9D49JY357Nhbp6VAQ
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015mYEP9D49JY357Nhbp6VAQ
|
🚀 Web preview deployed to: https://preview-16.treq-9zy.pages.dev |
- Replace CSS selectors (nav.navbar, a.navbar__brand, .theme-doc-sidebar-container) with ARIA role locators (navigation[Main], navigation[Docs sidebar], contentinfo) - Replace all page.goto() shortcuts with navigation from the landing page via UI - Replace all toHaveURL assertions with heading text assertions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015mYEP9D49JY357Nhbp6VAQ
Three rules scoped to web/e2e/**/*.ts, enforced in web-ci:
- no-e2e-css-locator: flags page.locator() calls with CSS class/ID
selectors (e.g. 'nav.navbar', '.sidebar', '#id'); use getByRole/
getByText/getByLabel instead.
- no-e2e-direct-url-goto: flags page.goto('/any/deep/path'); tests
must start from the landing page and navigate via UI interactions.
- no-e2e-url-assertion: flags toHaveURL() assertions; assert on
visible heading text instead.
Each rule has matching test cases and auto-generated snapshots.
web-ci installs @ast-grep/cli at the pinned root version and runs
ast-grep scan web/e2e as the final CI step.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015mYEP9D49JY357Nhbp6VAQ
Three new rules scoped to web/e2e/**/*.ts:
- no-e2e-xpath: flags page.locator('xpath=...') and page.locator('//')
— use getByRole/getByText instead of XPath selectors.
- no-e2e-js-evaluate: flags evaluate(), evaluateHandle(), evaluateAll(),
and addInitScript() — covers custom JS execution and DOM manipulation
via JavaScript.
- no-e2e-query-selector: flags deprecated Playwright query selector APIs
($, $$, $eval, $$eval) which bypass accessibility semantics.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015mYEP9D49JY357Nhbp6VAQ
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.
Sets up @playwright/test in web/, builds the Docusaurus site, and
serves it on a background dev server before running tests. Covers
navbar (Guides, Reference, Get Started, logo, GitHub link), sidebar
navigation within both the Guides and Reference sections, cross-
section switching, and footer links.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_015mYEP9D49JY357Nhbp6VAQ