[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-361":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":40,"readmeContent":41,"aiSummary":42,"trendingCount":16,"starSnapshotCount":16,"syncStatus":43,"lastSyncTime":44,"discoverSource":45},361,"playwright","microsoft\u002Fplaywright","microsoft","Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API. ","https:\u002F\u002Fplaywright.dev",null,"TypeScript",91082,5927,587,141,0,70,482,2223,338,120,"Apache License 2.0",false,"main",[26,27,28,29,30,31,32,33,5,34,35,36,37,38,39],"automation","chrome","chromium","e2e-testing","electron","end-to-end-testing","firefox","javascript","test","test-automation","testing","testing-tools","web","webkit","2026-06-17 04:00:02","# 🎭 Playwright\n\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fplaywright.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fplaywright) \u003C!-- GEN:chromium-version-badge -->[![Chromium version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fchromium-148.0.7778.96-blue.svg?logo=google-chrome)](https:\u002F\u002Fwww.chromium.org\u002FHome)\u003C!-- GEN:stop --> \u003C!-- GEN:firefox-version-badge -->[![Firefox version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ffirefox-150.0.2-blue.svg?logo=firefoxbrowser)](https:\u002F\u002Fwww.mozilla.org\u002Fen-US\u002Ffirefox\u002Fnew\u002F)\u003C!-- GEN:stop --> \u003C!-- GEN:webkit-version-badge -->[![WebKit version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fwebkit-26.4-blue.svg?logo=safari)](https:\u002F\u002Fwebkit.org\u002F)\u003C!-- GEN:stop --> [![Join Discord](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fjoin-discord-informational)](https:\u002F\u002Faka.ms\u002Fplaywright\u002Fdiscord)\n\n## [Documentation](https:\u002F\u002Fplaywright.dev) | [API reference](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-playwright)\n\nPlaywright is a framework for web automation and testing. It drives Chromium, Firefox, and WebKit with a single API — in your tests, in your scripts, and as a tool for AI agents.\n\n## Get Started\n\nChoose the path that fits your workflow:\n\n| | Best for | Install |\n|---|---|---|\n| **[Playwright Test](#playwright-test)** | End-to-end testing | `npm init playwright@latest` |\n| **[Playwright CLI](#playwright-cli)** | Coding agents (Claude Code, Copilot) | `npm i -g @playwright\u002Fcli@latest` |\n| **[Playwright MCP](#playwright-mcp)** | AI agents and LLM-driven automation | `npx @playwright\u002Fmcp@latest` |\n| **[Playwright Library](#playwright-library)** | Browser automation scripts | `npm i playwright` |\n| **[VS Code Extension](#vs-code-extension)** | Test authoring and debugging in VS Code | [Install from Marketplace](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=ms-playwright.playwright) |\n\n---\n\n## Playwright Test\n\nPlaywright Test is a full-featured test runner built for end-to-end testing. It runs tests across Chromium, Firefox, and WebKit with full browser isolation, auto-waiting, and web-first assertions.\n\n### Install\n\n```bash\nnpm init playwright@latest\n```\n\nOr add manually:\n\n```bash\nnpm i -D @playwright\u002Ftest\nnpx playwright install\n```\n\n### Write a test\n\n```TypeScript\nimport { test, expect } from '@playwright\u002Ftest';\n\ntest('has title', async ({ page }) => {\n  await page.goto('https:\u002F\u002Fplaywright.dev\u002F');\n  await expect(page).toHaveTitle(\u002FPlaywright\u002F);\n});\n\ntest('get started link', async ({ page }) => {\n  await page.goto('https:\u002F\u002Fplaywright.dev\u002F');\n  await page.getByRole('link', { name: 'Get started' }).click();\n  await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();\n});\n```\n\n### Run tests\n\n```bash\nnpx playwright test\n```\n\nTests run in parallel across all configured browsers, in headless mode by default. Each test gets a fresh browser context — full isolation with near-zero overhead.\n\n### Key capabilities\n\n**Auto-wait and web-first assertions.** No artificial timeouts. Playwright waits for elements to be actionable, and assertions automatically retry until conditions are met.\n\n**Locators.** Find elements with resilient locators that mirror how users see the page:\n\n```TypeScript\npage.getByRole('button', { name: 'Submit' })\npage.getByLabel('Email')\npage.getByPlaceholder('Search...')\npage.getByTestId('login-form')\n```\n\n**Test isolation.** Each test runs in its own browser context — equivalent to a fresh browser profile. Save authentication state once and reuse it across tests:\n\n```TypeScript\n\u002F\u002F Save state after login\nawait page.context().storageState({ path: 'auth.json' });\n\n\u002F\u002F Reuse in other tests\ntest.use({ storageState: 'auth.json' });\n```\n\n**Tracing.** Capture execution traces, screenshots, and videos on failure. Inspect every action, DOM snapshot, network request, and console message in the [Trace Viewer](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Ftrace-viewer):\n\n```TypeScript\n\u002F\u002F playwright.config.ts\nexport default defineConfig({\n  use: {\n    trace: 'on-first-retry',\n  },\n});\n```\n\n```bash\nnpx playwright show-trace trace.zip\n```\n\n\u003C!-- TODO: screenshot of trace viewer -->\n\n**Parallelism.** Tests run in parallel by default across all configured browsers.\n\n[Full testing documentation](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fintro)\n\n---\n\n## Playwright CLI\n\n[Playwright CLI](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli) is a command-line interface for browser automation designed for coding agents. It's more token-efficient than MCP — commands avoid loading large tool schemas and accessibility trees into the model context.\n\n### Install\n\n```bash\nnpm install -g @playwright\u002Fcli@latest\n```\n\nOptionally install skills for richer agent integration:\n\n```bash\nplaywright-cli install --skills\n```\n\n### Usage\n\nPoint your coding agent at a task:\n\n```\nTest the \"add todo\" flow on https:\u002F\u002Fdemo.playwright.dev\u002Ftodomvc using playwright-cli.\nTake screenshots for all successful and failing scenarios.\n```\n\nOr run commands directly:\n\n```bash\nplaywright-cli open https:\u002F\u002Fdemo.playwright.dev\u002Ftodomvc\u002F --headed\nplaywright-cli type \"Buy groceries\"\nplaywright-cli press Enter\nplaywright-cli screenshot\n```\n\n### Session monitoring\n\nUse `playwright-cli show` to open a visual dashboard with live screencast previews of all running browser sessions. Click any session to zoom in and take remote control.\n\n```bash\nplaywright-cli show\n```\n\n\u003C!-- TODO: screenshot of playwright-cli show dashboard -->\n\n[Full CLI documentation](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fcli-agent) | [GitHub](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli)\n\n---\n\n## Playwright MCP\n\nThe [Playwright MCP server](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp) gives AI agents full browser control through the [Model Context Protocol](https:\u002F\u002Fmodelcontextprotocol.io). Agents interact with pages using structured accessibility snapshots — no vision models or screenshots required.\n\n### Setup\n\nAdd to your MCP client (VS Code, Cursor, Claude Desktop, Windsurf, etc.):\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright\": {\n      \"command\": \"npx\",\n      \"args\": [\"@playwright\u002Fmcp@latest\"]\n    }\n  }\n}\n```\n\n**One-click install for VS Code:**\n\n[\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVS_Code-VS_Code?style=flat-square&label=Install%20MCP%20Server&color=0098FF\" alt=\"Install in VS Code\" \u002F>](https:\u002F\u002Finsiders.vscode.dev\u002Fredirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)\n\n**For Claude Code:**\n\n```bash\nclaude mcp add playwright npx @playwright\u002Fmcp@latest\n```\n\n### How it works\n\nAsk your AI assistant to interact with any web page:\n\n```\nNavigate to https:\u002F\u002Fdemo.playwright.dev\u002Ftodomvc and add a few todo items.\n```\n\nThe agent sees the page as a structured accessibility tree:\n\n```\n- heading \"todos\" [level=1]\n- textbox \"What needs to be done?\" [ref=e5]\n- listitem:\n  - checkbox \"Toggle Todo\" [ref=e10]\n  - text: \"Buy groceries\"\n```\n\nIt uses element refs like `e5` and `e10` to click, type, and interact — deterministically and without visual ambiguity. Tools cover navigation, form filling, screenshots, network mocking, storage management, and more.\n\n[Full MCP documentation](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fmcp) | [GitHub](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp)\n\n---\n\n## Playwright Library\n\nUse `playwright` as a library for browser automation scripts — web scraping, PDF generation, screenshot capture, and any workflow that needs programmatic browser control without a test runner.\n\n### Install\n\n```bash\nnpm i playwright\n```\n\n### Examples\n\n**Take a screenshot:**\n\n```TypeScript\nimport { chromium } from 'playwright';\n\nconst browser = await chromium.launch();\nconst page = await browser.newPage();\nawait page.goto('https:\u002F\u002Fplaywright.dev\u002F');\nawait page.screenshot({ path: 'screenshot.png' });\nawait browser.close();\n```\n\n**Generate a PDF:**\n\n```TypeScript\nimport { chromium } from 'playwright';\n\nconst browser = await chromium.launch();\nconst page = await browser.newPage();\nawait page.goto('https:\u002F\u002Fplaywright.dev\u002F');\nawait page.pdf({ path: 'page.pdf', format: 'A4' });\nawait browser.close();\n```\n\n**Emulate a mobile device:**\n\n```TypeScript\nimport { chromium, devices } from 'playwright';\n\nconst browser = await chromium.launch();\nconst context = await browser.newContext(devices['iPhone 15']);\nconst page = await context.newPage();\nawait page.goto('https:\u002F\u002Fplaywright.dev\u002F');\nawait page.screenshot({ path: 'mobile.png' });\nawait browser.close();\n```\n\n**Intercept network requests:**\n\n```TypeScript\nimport { chromium } from 'playwright';\n\nconst browser = await chromium.launch();\nconst page = await browser.newPage();\nawait page.route('**\u002F*.{png,jpg,jpeg}', route => route.abort());\nawait page.goto('https:\u002F\u002Fplaywright.dev\u002F');\nawait browser.close();\n```\n\n[Library documentation](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Flibrary) | [API reference](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-playwright)\n\n---\n\n## VS Code Extension\n\nThe [Playwright VS Code extension](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=ms-playwright.playwright) brings test running, debugging, and code generation directly into your editor.\n\n\u003C!-- TODO: hero screenshot of VS Code with Playwright sidebar -->\n\n**Run and debug tests** from the editor with a single click. Set breakpoints, inspect variables, and step through test execution with a live browser view.\n\n**Generate tests with CodeGen.** Click \"Record new\" to open a browser — navigate and interact with your app while Playwright writes the test code for you.\n\n**Pick locators.** Hover over any element in the browser to see the best available locator, then click to copy it to your clipboard.\n\n**Trace Viewer integration.** Enable \"Show Trace Viewer\" in the sidebar to get a full execution trace after each test run — DOM snapshots, network requests, console logs, and screenshots at every step.\n\n[Install the extension](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=ms-playwright.playwright) | [VS Code guide](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fgetting-started-vscode)\n\n---\n\n## Cross-Browser Support\n\n|          | Linux | macOS | Windows |\n|   :---   | :---: | :---: | :---:   |\n| Chromium\u003Csup>1\u003C\u002Fsup> \u003C!-- GEN:chromium-version -->148.0.7778.96\u003C!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| WebKit \u003C!-- GEN:webkit-version -->26.4\u003C!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| Firefox \u003C!-- GEN:firefox-version -->150.0.2\u003C!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n\nHeadless and headed execution on all platforms. \u003Csup>1\u003C\u002Fsup> Uses [Chrome for Testing](https:\u002F\u002Fdeveloper.chrome.com\u002Fblog\u002Fchrome-for-testing) by default.\n\n## Other Languages\n\nPlaywright is also available for [Python](https:\u002F\u002Fplaywright.dev\u002Fpython\u002Fdocs\u002Fintro), [.NET](https:\u002F\u002Fplaywright.dev\u002Fdotnet\u002Fdocs\u002Fintro), and [Java](https:\u002F\u002Fplaywright.dev\u002Fjava\u002Fdocs\u002Fintro).\n\n## Resources\n\n* [Documentation](https:\u002F\u002Fplaywright.dev)\n* [API reference](https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-playwright)\n* [MCP server](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-mcp)\n* [CLI for coding agents](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-cli)\n* [VS Code extension](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright-vscode)\n* [Contribution guide](CONTRIBUTING.md)\n* [Changelog](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Freleases)\n* [Discord](https:\u002F\u002Faka.ms\u002Fplaywright\u002Fdiscord)\n","Playwright 是一个用于网页测试和自动化的框架，支持通过单一API对Chromium、Firefox和WebKit进行操作。其核心功能包括跨浏览器的端到端测试、自动等待机制以及针对Web优化的断言，确保了测试的准确性和效率。Playwright 适用于需要在不同浏览器环境下执行自动化任务或开展全面测试的场景，如网站功能验证、性能测试等。凭借其强大的兼容性和易用性，无论是开发人员还是测试工程师都能轻松上手使用Playwright来提高工作效率。",2,"2026-06-17 02:34:32","top_all"]