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.

Path progress
50%

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.

Running on Chromium, Firefox, WebKitDrag stickies · tap for tips
Study mapDrag stickies · tap for tipsKeep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Assert the UIdrag · tap →Retry wiselydrag · tap →Seed datadrag · tap →Close the loopdrag · tap →Keep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Pathwise hackdrag · tap →Page under testdrag · tap →Multi-browserdrag · tap →Automation pathdrag · tap →Tooling nodedrag · tap →

Try it

Run / study this snippet

pytest --browser chromium
pytest --browser firefox
pytest --browser webkit
Was this step clear?
Chapter 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.