by mkjaswanth
Python Playwright + pytest QA skill for runnable UI/API tests, storage_state auth caching, xdist worker isolation, cleanup tracking, and HTML/trace failure reports.
npx @qaskills/cli add python-playwright-pytest-suiteAuto-detects your AI agent and installs the skill. Works with Claude Code, Cursor, Copilot, and more.
Build Python UI and API tests with Playwright and pytest. Inspect an existing suite before changing its fixtures. Copy the bundled starter for a new suite.
Prerequisites: Python 3.10+ and Playwright. From the starter directory:
python -m pip install -r requirements.txt python -m playwright install chromium python run_tests.py
The demo needs no external account. Real suites must set SUPER_ADMIN_EMAIL and SUPER_ADMIN_PASSWORD and must not commit passwords or .auth files.
Authentication: log in once per worker and reuse Playwright storage_state. auth_state_path signs in through the UI, checks the post-login URL, and writes .auth/super_admin_.json. Load that file from browser_context_args so screenshots, video, and traces still attach. Use login_through_ui only for tests of the login form.
Cleanup: register each created resource with track immediately. Teardown runs after failures, deletes in reverse order, and includes the pytest-xdist worker id. Name shared data with resource_name, for example role-gw0-a1b2c3.
Local servers: set APP_START_CMD and BASE_URL (or HEALTHCHECK_URL). run_tests.py starts the process, waits until it responds, runs pytest, and returns pytest's exit code after stopping the process tree.
Reports: pytest-html writes reports/report.html. Browser failures keep screenshots, video, and traces under reports/failures/.
Also covers worker isolation for pytest -n, WCAG 2.1 AA scans, end-to-end anti-patterns, CI, and Python visual regression. Source: https://github.com/MKJaswanth/playwright-pytest-qa-skill
- name: Install QA Skills
run: npx @qaskills/cli add python-playwright-pytest-suite6 of 29 agents supported
Go from zero to Playwright pro: Page Object Model, fixtures, and CI/CD on real projects.