playwright-python

Provides reference documentation for writing and debugging Playwright browser automation tests in Python.

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/t-jet/pal_found_cli --skill playwright-python-t-jet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-python
Source: https://github.com/t-jet/pal_found_cli/tree/main/.ept/skills/playwright-python
Command: npx skills add https://github.com/t-jet/pal_found_cli --skill playwright-python-t-jet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing browser automation and end-to-end tests with Playwright for Python requires knowing dozens of APIs, locator strategies, and configuration options, and this Skill gives an AI agent authoritative reference material to answer questions and generate correct code. ## Core Features & Use Cases - Core Guides: Conceptual documentation covering installation, writing and running tests, locators, auto-waiting, network interception, authentication, emulation, debugging, CI setup, and Docker. - API Reference: Class-level documentation for all Playwright Python objects including Page, Browser, BrowserContext, Locator, APIRequestContext, and assertion classes. - Use Case: When asked to write a pytest test that logs into a web app and reuses the authenticated session, the agent consults the auth and browser-contexts guides to produce correct storage_state code. ## Quick Start Ask the agent to write a Playwright Python test that navigates to a page, fills a login form, and asserts the resulting page title.

Frequently Asked Questions about playwright-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write end-to-end tests with Playwright in Python?

Playwright Python tests use the pytest-playwright package, which provides page and context fixtures. You write test functions that use locators like page.get_by_role() to interact with elements and expect() assertions to verify page state.

How to reuse login state across Playwright Python tests?

Playwright lets you save authenticated state with browser_context.storage_state(path="state.json") after logging in once. New browser contexts can then be created with storage_state="state.json" to skip the login step in every test.

Does Playwright Python support async and sync APIs?

Yes, Playwright for Python provides both a synchronous API via playwright.sync_api and an asyncio-based API via playwright.async_api. Both expose the same classes and methods, differing only in await usage.

Can Playwright Python test REST APIs without a browser?

Yes, the APIRequestContext class sends HTTP requests directly without launching a browser. You create it via playwright.request.new_context() and use methods like get, post, and delete to test server APIs or prepare test state.

Why does my Playwright test fail with a TimeoutError?

Playwright auto-waits for actionability checks such as visibility, stability, and enabled state before acting on elements. A TimeoutError means these checks did not pass within the configured timeout, often due to incorrect locators or elements obscured by overlays.

How do I run Playwright Python tests in CI or Docker?

Playwright provides official Docker images and CI guides for GitHub Actions, Azure Pipelines, and GitLab CI. The core/ci.mdx and core/docker.mdx references cover installing browser dependencies and configuring pipelines.