Skip to content

Add Playwright e2e tests for web public navigation#16

Open
Ziinc wants to merge 5 commits into
mainfrom
claude/web-e2e-nav-tests-qaiv07
Open

Add Playwright e2e tests for web public navigation#16
Ziinc wants to merge 5 commits into
mainfrom
claude/web-e2e-nav-tests-qaiv07

Conversation

@Ziinc

@Ziinc Ziinc commented Jul 6, 2026

Copy link
Copy Markdown
Owner

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

claude added 2 commits July 6, 2026 07:12
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
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🚀 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants