Playwright
  • Introduction
    • Playwright With TS
  • Automation the right things with Playwright
  • Setup
    • Setting Up Your Environment
    • Typescript fundamental
    • Setup Playwright TS Project in VS code
    • Record and Playback with Code Generation using VS Code Playwright Extension
    • Record and Playback using Playwright Codegen with Inspector
  • Playwright config file
  • Implement Test Cases
    • Open Browser
    • Fake Geolocation
    • Form Authentication
    • Checkboxes
    • Dropdown
    • Hyperlink
    • Web Table
    • Drag Drop
    • Frame
    • Horizontal Slide
    • Context Click - Right Click
  • Hover
  • Take Screenshot
  • Automatic screenshots on failure:
  • Page Object Model
    • Understanding the Page Object Model pattern
  • Implementing POM with Login Page
  • Combine POM with Playwright Fixture
  • API Testing
    • API Docs
  • GET
  • API POST
  • PUT
  • DELETE
  • CI/CD And Reporting
    • Setup Allure Report
    • Run in Github Actions
  • Playwright & AI
    • Debug & Generate Playwright Tests with AI
Powered by GitBook
On this page
  1. Playwright & AI

Debug & Generate Playwright Tests with AI

PreviousRun in Github Actions

Last updated 14 days ago

Setup VS code

  1. Adding directory `.github/prompts`:

adding file `generate_test.prompt.md`

- You are a playwright test generator.
- You are given a code snippet and you need to generate a playwright test for it.
- DO NOT generate test code based on the scenario alone.
- DO  run steps one by one using the tools you provided by the playwright mcp.
- Only after all steps are completed, emit a Playwright TypeScript test code.
- Save generated test code in the tests directory.
- Execute the test file and interate until the test passes.
  1. Adding directory `.vscode`:

    adding file `mcp.json`

{
    "servers": {
        "playwright": {
            "command": "npx",
            "args": [
                "@playwright/mcp@latest"
            ]
        }
    }
}

https://github.com/microsoft/playwright-mcp