Skip to content

Add automated playwright tests#112

Closed
edmcman wants to merge 38 commits into
lydell:mainfrom
edmcman:playwright-tests
Closed

Add automated playwright tests#112
edmcman wants to merge 38 commits into
lydell:mainfrom
edmcman:playwright-tests

Conversation

@edmcman
Copy link
Copy Markdown

@edmcman edmcman commented Dec 30, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 30, 2025 21:41
@edmcman edmcman marked this pull request as draft December 30, 2025 21:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds automated end-to-end testing infrastructure using Playwright to test the Link Hints browser extension. The tests walk through the interactive tutorial, verifying that the extension's hint system works correctly across different modes and interactions.

Key Changes

  • Adds Playwright test framework with Firefox browser support
  • Implements comprehensive tutorial walkthrough test with snapshot testing
  • Modifies shadow DOM mode to be "open" in development for test accessibility
  • Adds CI workflow to run tests automatically on pull requests
  • Includes devcontainer configuration for consistent development environment

Reviewed changes

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

Show a summary per file
File Description
tests/tutorial.spec.ts Main test file implementing tutorial walkthrough with helper functions for hint activation and snapshotting
playwright.config.ts Configures Playwright with Firefox in headed mode (required for extensions) with 60s timeout
package.json Adds Playwright dependencies and test:playwright script
src/renderer/Program.ts Changes shadow DOM mode from "closed" to "open" in dev mode for test accessibility
project.config.ts Modifies compiled output path to "compiled-dev" when not building for production
.github/workflows/ci.yml Adds test job with xvfb for headless browser testing in CI
.devcontainer/devcontainer.json Configures dev container with Node 18, xvfb, and Playwright dependencies
.github/copilot-instructions.md Documents project structure and conventions for AI assistants
.gitignore & .prettierignore Excludes test results and snapshot directories
tests/-snapshots/.html Snapshot files for visual regression testing of hint rendering
tests/-snapshots/.png Screenshot snapshots for visual comparison

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

Comment thread tests/tutorial.spec.ts
);

// Press 'o'
await page.keyboard.press("e");
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

The comment says "Press 'o'" but the code presses 'e'. This inconsistency between the comment and the implementation suggests either the comment is wrong or the wrong key is being pressed.

Suggested change
await page.keyboard.press("e");
await page.keyboard.press("o");

Copilot uses AI. Check for mistakes.
Comment thread tests/tutorial.spec.ts
undefined
);
// UGH I want to get rid of this so bad.
await page.waitForTimeout(200);
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

This hardcoded wait timeout is a test anti-pattern that can cause flakiness. The comment indicates the author wants to remove it. Consider replacing with a proper wait condition that checks for the actual state change you're waiting for, or use Playwright's auto-waiting features.

Suggested change
await page.waitForTimeout(200);

Copilot uses AI. Check for mistakes.
@edmcman edmcman closed this Dec 31, 2025
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