Skip to content

feat(js): add playwright+mocha test to capture test context#267

Merged
Garbee merged 1 commit into
mainfrom
capture-test-context
May 20, 2026
Merged

feat(js): add playwright+mocha test to capture test context#267
Garbee merged 1 commit into
mainfrom
capture-test-context

Conversation

@gupta-tanvi26

@gupta-tanvi26 gupta-tanvi26 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Adds a new js/playwright/capture-context example demonstrating how to attach Mocha test context (file path + title path) to axe Watcher scans via PlaywrightController.setTestContext.

Closes - #268

@gupta-tanvi26 gupta-tanvi26 marked this pull request as ready for review May 20, 2026 00:11
@gupta-tanvi26 gupta-tanvi26 requested a review from a team as a code owner May 20, 2026 00:11
Copilot AI review requested due to automatic review settings May 20, 2026 00:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Playwright + Mocha example (js/playwright/capture-context) showing how to manually attach Mocha test context (test file path + title path) to axe Watcher scans via PlaywrightController.setTestContext(...), addressing watcher-examples issue #268.

Changes:

  • Introduces a Mocha test suite that creates a fresh Playwright page per test and sets/clears axe Watcher test context in beforeEach/afterEach.
  • Adds a second “logout” flow test to demonstrate multiple tests with distinct context.
  • Adds a minimal package.json to run the example with Mocha.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
js/playwright/capture-context/tests/login.js New Mocha + Playwright tests wiring setTestContext per-test and clearing it after flushing.
js/playwright/capture-context/package.json New example package config (deps + mocha test script).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread js/playwright/capture-context/tests/login.js
Comment thread js/playwright/capture-context/tests/login.js
Comment thread js/playwright/capture-context/tests/login.js
Comment thread js/playwright/capture-context/tests/login.js

@Garbee Garbee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Garbee

Garbee commented May 20, 2026

Copy link
Copy Markdown
Member

Failing smoke test is not relevant to this. Seems like a flake.

@Garbee Garbee merged commit ef9ed37 into main May 20, 2026
61 of 66 checks passed
@Garbee Garbee deleted the capture-test-context branch May 20, 2026 01:15
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.

3 participants