Skip to content

feat(web): playwright screenshot support#3047

Open
vishna wants to merge 5 commits into
leancodepl:masterfrom
vishna:web_screenshot
Open

feat(web): playwright screenshot support#3047
vishna wants to merge 5 commits into
leancodepl:masterfrom
vishna:web_screenshot

Conversation

@vishna

@vishna vishna commented May 4, 2026

Copy link
Copy Markdown

Description

This PR implements the screenshot method for the web platform, enabling automated screenshot capture during web integration tests. It integrates Playwright's native screenshot capabilities into the Patrol WebAutomator API.

Changes

packages/patrol

  • Added screenshot({required String path}) to the WebAutomator interface.
  • Implemented WebAutomator.screenshot to send a screenshot command to the Playwright runner.

web_runner (Playwright)

  • Added a new screenshot action in packages/patrol/web_runner/tests/actions/screenshot.ts using page.screenshot().
  • Updated actions.ts and contracts.ts to register and map the new screenshot request.

Verification

  • Verified that calling $.platform.web.screenshot(path: 'path/to/screenshot.png') correctly triggers Playwright to save a screenshot at the specified location.

@github-actions github-actions Bot added the package: patrol Related to the patrol package (native automation, test bundling) label May 4, 2026
@vishna vishna changed the title feat(web): implement playwright screenshot support feat(web): playwright screenshot support May 4, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a screenshot feature for the web platform in Patrol. It adds the screenshot method to the WebAutomator interface and its implementation, creates a new Playwright action, and updates the corresponding request contracts. Feedback focuses on maintaining alphabetical consistency in imports and type definitions, as well as improving the robustness of the screenshot action by ensuring the target directory exists before saving the file.

Comment thread packages/patrol/web_runner/tests/actions.ts Outdated
Comment thread packages/patrol/web_runner/tests/contracts.ts Outdated
Comment thread packages/patrol/web_runner/tests/actions/screenshot.ts
vishna and others added 3 commits May 4, 2026 19:30
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: patrol Related to the patrol package (native automation, test bundling)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant