-
Notifications
You must be signed in to change notification settings - Fork 5.5k
docs: playwright CLI skill tutorial #7261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
debs-obrien
merged 20 commits into
aaif-goose:main
from
debs-obrien:debbieobrien/playwright-skills-tutorial
Feb 17, 2026
Merged
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
bc8d7f0
Add Playwright Skills tutorial for agentic testing
debs-obrien abe2cdd
Update tutorial to use navigation instead of search
debs-obrien b576702
Update example prompt to include full navigation flow
debs-obrien af975ce
Add detailed explanation of how test generation works
debs-obrien e27e4af
Fix prerequisites and add monitoring capability from official docs
debs-obrien b95cf20
Add visual dashboard tip for show command
debs-obrien 8ea632b
Replace show command tip with headed mode tip (show not yet available…
debs-obrien a0ce934
Add Visual Dashboard section for monitoring multiple sessions
debs-obrien 6858c36
Rewrite Visual Dashboard section in our own words
debs-obrien 218731c
Simplify Visual Dashboard description to be more conversational
debs-obrien fd7c024
Fix capitalization and remove extra blank lines
debs-obrien 23bba2f
Convert token efficiency section to a paragraph
debs-obrien ab5d6ba
Simplify intro paragraph and remove duplicate section
debs-obrien 2be07f8
Update documentation/docs/tutorials/playwright-skills.md
debs-obrien 8d4384e
fix: align YouTube embed with tutorial pattern for responsive layout …
debs-obrien 2ac4245
fix: correct terminology for Playwright skills and improve clarity in…
debs-obrien 3618a4c
fix: update installation command and correct folder name for Playwrig…
debs-obrien 12b199a
fix: correct title and improve resource list for Playwright skill doc…
debs-obrien aab0241
cleaning up
angiejones e35e3e1
Update documentation/docs/tutorials/playwright-skill.md
debs-obrien File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,203 @@ | ||
| --- | ||
| title: Agentic Testing with Playwright Skills | ||
| description: Use goose with Playwright CLI skills to automate browsers and generate tests using natural language | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
| --- | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; | ||
| import GooseBuiltinInstaller from '@site/src/components/GooseBuiltinInstaller'; | ||
|
|
||
| <iframe width="560" height="315" src="https://www.youtube.com/embed/_MpbmD_unnU?si=dpHvuLVkbONN_0Hk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
|
|
||
| With [Playwright CLI](https://github.com/microsoft/playwright-cli) skills, goose can navigate websites, click buttons, fill forms, and turn those interactions into Playwright tests—all from plain English. Unlike the Playwright MCP, which sends the full page structure to the LLM on every request, Playwright CLI stores the accessibility tree locally. That means faster responses, lower costs, and no issues with large pages. | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Prerequisites | ||
|
|
||
| - [Node.js](https://nodejs.org/) 18 or later | ||
| - Install Playwright CLI globally: | ||
| ```bash | ||
| npm install -g @playwright/cli@latest | ||
| ``` | ||
| - (Optional) [Playwright](https://playwright.dev/) installed if you want to run the generated tests (`npm init playwright@latest`) | ||
|
|
||
| ## Configuration | ||
|
|
||
| First, install the Playwright skills in your project directory: | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```bash | ||
| playwright-cli install --skills | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| This creates a `.claude/` folder with skills and reference files that teach goose how to use Playwright CLI capabilities. | ||
|
|
||
| Then, enable the [Skills extension](/docs/mcp/skills-mcp) to allow goose to load and use Agent Skills. | ||
|
|
||
| <Tabs groupId="interface"> | ||
| <TabItem value="ui" label="goose Desktop" default> | ||
| <GooseBuiltinInstaller | ||
| extensionName="Skills" | ||
| /> | ||
| </TabItem> | ||
| <TabItem value="cli" label="goose CLI"> | ||
|
|
||
| 1. Run the `configure` command: | ||
| ```sh | ||
| goose configure | ||
| ``` | ||
|
|
||
| 2. Choose to `Toggle Extensions` | ||
| ```sh | ||
| ┌ goose-configure | ||
| │ | ||
| ◇ What would you like to configure? | ||
| │ Toggle Extensions | ||
| │ | ||
| ◆ Enable extensions: (use "space" to toggle and "enter" to submit) | ||
| // highlight-start | ||
| │ ● skills | ||
| // highlight-end | ||
| | | ||
| └ Extension settings updated successfully | ||
| ``` | ||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
|
|
||
| ## Generate a Test with Video and Traces | ||
|
|
||
| Give goose a single prompt that describes what you want to test: | ||
|
|
||
| ``` | ||
| Open block.github.io/goose, click on the Docs menu, click on Context Engineering, | ||
| then click on Using Skills and generate a test with video and traces | ||
| ``` | ||
|
|
||
| ### How It Works | ||
|
|
||
| Each `playwright-cli` command automatically outputs the corresponding Playwright code. For example: | ||
|
|
||
| ```bash | ||
| playwright-cli click e11 | ||
| # Ran Playwright code: | ||
| # await page.getByRole('link', { name: 'Docs' }).click(); | ||
| ``` | ||
|
|
||
| ### What goose Does | ||
|
|
||
| 1. Opens the browser: `playwright-cli open block.github.io/goose` | ||
| 2. Starts recording: `playwright-cli video-start` and `playwright-cli tracing-start` | ||
| 3. Takes snapshots to find elements: `playwright-cli snapshot` | ||
| 4. Performs clicks: `playwright-cli click <ref>` | ||
| 5. Stops recording: `playwright-cli video-stop` and `playwright-cli tracing-stop` | ||
| 6. Assembles the generated code into a test file | ||
|
|
||
| ### Generated Files | ||
|
|
||
| | File | Description | | ||
| |------|-------------| | ||
| | `tests/using-skills-navigation.spec.ts` | Your Playwright test | | ||
| | `.playwright-cli/video-*.webm` | Video recording of the session | | ||
| | `.playwright-cli/traces/*.trace` | Trace file for debugging | | ||
|
|
||
| ### Generated Test Code | ||
|
|
||
| The generated test might look like: | ||
|
|
||
| ```typescript | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test('navigate to Using Skills guide via docs menu', async ({ page }) => { | ||
| await page.goto('https://block.github.io/goose'); | ||
| await expect(page).toHaveTitle(/goose/); | ||
|
|
||
| // Click on Docs in the navigation | ||
| await page.getByRole('link', { name: 'Docs' }).click(); | ||
|
|
||
| // Expand Context Engineering category | ||
| await page.getByRole('button', { name: 'Expand sidebar category \'Context Engineering\'' }).click(); | ||
|
|
||
| // Click on Using Skills | ||
| await page.getByRole('link', { name: 'Using Skills' }).click(); | ||
|
|
||
| // Verify navigation | ||
| await expect(page).toHaveURL(/using-skills/); | ||
| await expect(page.getByRole('heading', { level: 1 })).toContainText('Using Skills'); | ||
| }); | ||
| ``` | ||
|
|
||
| ### Running the Test | ||
|
|
||
| goose can even run the test for you to make sure it works as expected. If Playwright is already set up, just ask it to run the test. If not, goose can install Playwright for you and then run the test. | ||
|
|
||
| ## Viewing the Video | ||
|
|
||
| To see a video of what happened, ask goose: | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
|
|
||
| ``` | ||
| Show me the video | ||
| ``` | ||
|
|
||
| goose will open the recorded video so you can see exactly what happened during the session. | ||
|
|
||
| ### Viewing the Trace | ||
|
debs-obrien marked this conversation as resolved.
Outdated
|
||
|
|
||
| To debug or review what happened, ask goose: | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
|
|
||
| ``` | ||
| Open the trace | ||
| ``` | ||
|
|
||
| The trace viewer shows: | ||
| - Timeline of all actions | ||
| - Screenshots before/after each action | ||
| - Console logs and errors | ||
| - Network requests | ||
| - Element locators used | ||
|
|
||
| ## Visual Dashboard for Multiple Sessions | ||
|
|
||
| When you have goose running several browser tasks at once, it can be hard to keep track of what's happening. The visual dashboard gives you a bird's-eye view of all your active browser sessions, letting you watch progress in real-time or jump in and take control when needed. | ||
|
|
||
| ```bash | ||
| playwright-cli show | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| From here you can see live previews of every browser goose is controlling. Click into any session to watch it full-size, or take over the mouse and keyboard yourself if goose needs a hand. Press **Escape** when you're done and goose picks up right where you left off. | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Full Capabilities | ||
|
|
||
| Want to know what else the Playwright skills can do? Ask goose: | ||
|
|
||
| ``` | ||
| What else can you do with playwright skills? | ||
| ``` | ||
|
|
||
| | Category | Capabilities | | ||
| |----------|-------------| | ||
| | **Browser Control** | open, goto, click, fill, close | | ||
| | **Capture & Debug** | screenshot, snapshot, video, trace | | ||
| | **Tab Management** | Open, switch, close tabs | | ||
| | **Storage & Auth** | Save/restore cookies, handle login states | | ||
| | **Network** | Mock APIs, intercept requests | | ||
| | **Input** | Type text, press keys, mouse actions | | ||
|
|
||
| ### Example Use Cases | ||
|
|
||
| - ✅ Test web applications with natural language | ||
| - ✅ Fill out forms automatically | ||
| - ✅ Scrape data from websites | ||
| - ✅ Debug issues with video recordings | ||
| - ✅ Test authentication flows | ||
| - ✅ Record demos for documentation | ||
| - ✅ Mock APIs for isolated testing | ||
|
|
||
| ## Conclusion | ||
|
|
||
| Getting started with Playwright skills is easy and opens up powerful browser automation capabilities directly from natural language prompts. Whether you're generating tests, debugging with videos and traces, or automating complex interactions, the Playwright CLI skills provide a token-efficient way to leverage Playwright's full power with goose. | ||
|
|
||
| ## Resources | ||
|
|
||
| - [Playwright Documentation](https://playwright.dev) | ||
|
angiejones marked this conversation as resolved.
Outdated
|
||
| - [Playwright CLI GitHub](https://github.com/microsoft/playwright-cli) | ||
| - [Using Skills Guide](/docs/guides/context-engineering/using-skills) - Learn how to create and use skills with goose | ||
| - [Skills Extension Documentation](/docs/mcp/skills-mcp) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.