public/uploads/rules/playwright with-ai/rule (PR from TinaCMS)#12659
Open
tina-cloud-app[bot] wants to merge 20 commits intomainfrom
Open
public/uploads/rules/playwright with-ai/rule (PR from TinaCMS)#12659tina-cloud-app[bot] wants to merge 20 commits intomainfrom
tina-cloud-app[bot] wants to merge 20 commits intomainfrom
Conversation
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Contributor
🔍 Preview PR ChangesView updated pages in edit mode:
|
Contributor
|
Hi @tina-cloud-app[bot], Rule: ../../public/uploads/rules/playwright-with-ai/rule.mdxIssues Detected:
Please fix the Frontmatter in your Markdown files. |
Contributor
|
👋 Hi @suiyangqiu, This PR is currently in Draft mode. To help it get reviewed and merged:
Once you've completed these steps, your PR will be ready for approval! This is an automated reminder to help reduce draft PRs without descriptions or reviewers. |
Add full rule content covering the four ways to combine Playwright with AI coding agents: the Playwright MCP server, the CLI plus codegen, and the official Test Agents (Planner, Generator, Healer). Includes good/bad examples, install snippets for Claude Code, VS Code, Cursor, and best-practice guidance on locator strategy and the record-then-refine workflow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Add a new "Using Playwright for AI-driven development" section covering the inner-loop dev workflow (verify changes, reproduce bugs, explore before editing, deep-link iteration, component playground checks, network mocking) - the under-served angle where the agent uses Playwright to close its own "is it done?" loop rather than for testing. Replace the best-practices bullets with a tighter mix of agent behaviour and setup safety: POM, run-before-declare-success, role-based locators, scoped origins with --isolated, and one-test- at-a-time iteration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Michael Qiu <MichaelQiu@ssw.com.au>
Lewkans
approved these changes
May 6, 2026
|
|
||
| Without access to a browser, agents have to guess and assume what the UI looks like. This means that it writes selectors blindly, and can't see the results of its own changes. In turn, it can ship tests that break the moment they're run and build features that look completely wrong without a second thought. | ||
|
|
||
| By giving the agent Playwright, we can close this loop and set up a sort of iterative inner loop for the agent to check its own changes, allowing for: |
Member
There was a problem hiding this comment.
Suggested change
| By giving the agent Playwright, we can close this loop and set up a sort of iterative inner loop for the agent to check its own changes, allowing for: | |
| By giving the agent access to Playwright, we can close this loop and set up an iterative inner loop for the agent to check its own changes, allowing for: |
|
|
||
| For most day-to-day test authoring, building, and usage, the Playwright CLI driven by your AI Agent is faster and cheaper than using the MCP to drive. In many cases, using the CLI with a coding agent uses approximately **4x fewer tokens** compared to a run with the same prompt to an agent using the MCP. | ||
|
|
||
| ### Using Playwright CLI with Codegen (Optional) |
Member
There was a problem hiding this comment.
is there a link to it? or is it part of the cli installation as optional? Would be good to clarify this in the first line
Co-authored-by: Lewis Toh [SSW] <88498002+Lewkans@users.noreply.github.com>
Co-authored-by: Hark Singh [SSW] <harksingh@ssw.com.au>
Co-authored-by: Hark Singh [SSW] <harksingh@ssw.com.au>
Co-authored-by: Hark Singh [SSW] <harksingh@ssw.com.au>
Co-authored-by: Hark Singh [SSW] <harksingh@ssw.com.au>
Co-authored-by: Hark Singh [SSW] <harksingh@ssw.com.au>
Co-authored-by: Hark Singh [SSW] <harksingh@ssw.com.au>
Co-authored-by: Hark Singh [SSW] <harksingh@ssw.com.au>
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.
Summary of Changes