Bookmark added by

#python #testing #browser testing



Playwright for Python

Cross-browser end-to-end testing for modern web apps

My notes

Playwright for Python

A Python interface to the very handy Playwright browser automation library. The 1.9.x releases feel more Pythonic. Naming conventions, stuff like that. Feels much less like just a wrapper.

Don’t forget to install browser drivers whenever you install or upgrade Playwright!

$ python -m playwright install

With pytest

The pytest-playwright plugin provides fixtures, marks, and extra pytest args for browser testing. So far the only fixture I’ve used is page, the standin for a default browser session. Pairs nicely with pytest-django’s live_server fixture.

Headless by default, but use pytest --headful if you want to watch the browser do its thing.