Manuals / Playwright with Python / Chapter 31
Part 4 · Advanced Techniques · advanced · ~40 min · Chapter 31 of 61
23. Cross-browser & Cross-device Testing
Running on Chromium, Firefox, WebKit pytest --browser chromium pytest --browser firefox pytest --browser webkit Or parametrized directly in code/config to run against all three in one CI pipeline run. --browser (pytest-playwright CLI flag) What it does: Selects which browser engine the test session launches.
Step 1 of 3
Running on Chromium, Firefox, WebKit
Or parametrized directly in code/config to run against all three in one CI pipeline run. --browser (pytest-playwright CLI flag) What it does: Selects which browser engine the test session launches. Types/params: "chromium" (default), "firefox", "webkit". Pointers: Running the full suite three times (once per browser) in CI catches engine-specific bugs before real users do — a common setup is a CI matrix job that runs the same suite once per browser value in parallel.
Try it
Run / study this snippet
pytest --browser chromium
pytest --browser firefox
pytest --browser webkitChapter learning outcomes
- Running on Chromium, Firefox, WebKit
- Mobile emulation (device descriptors, viewport, geolocation)
Clear these before you leave
Side quest
23. Cross-browser & Cross-device Testing deliverable
Apply one idea from “Running on Chromium, Firefox, WebKit” in a small script or note.