I bookmarked Playwright for Python on Sunday, 28 February, 2021

Playwright for Python

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

My Notes

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.

Site Links