Manuals / Playwright with Python / Chapter 40

Part 6 · Pro-Level Practices · pro · ~45 min · Chapter 40 of 61

30. Managing Test Suites at Scale

Test tagging and selective execution across large suites Building directly on Chapter 13's markers, at scale you typically layer multiple tagging dimensions rather than one flat list: @pytest.mark.smoke @pytest.mark.module_leave @pytest.mark.critical def test_leave_request_approval_flow(): ... pytest -m "smoke and module_leave" # only smoke tests for the Leave module pytest -m "critical and not sl

Path progress
64%

Step 1 of 4

Test tagging and selective execution across large suites

Building directly on Chapter 13's markers, at scale you typically layer multiple tagging dimensions rather than one flat list: ... Pointers: Combine markers with boolean expressions (and, or, not) for precise slicing — e.g., running just the critical-path tests for one module before a targeted deploy, without running the entire suite.

Test tagging and selective execution across large suitesDrag 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 -m "smoke and module_leave"        # only smoke tests for the Leave module
Was this step clear?
Chapter learning outcomes
  • Test tagging and selective execution across large suites
  • Diagnosing and managing flaky tests systematically
  • Writing custom reporters/plugins
  • Integrating with test management tools (TestRail, Xray)

Clear these before you leave

Side quest

30. Managing Test Suites at Scale deliverable

Apply one idea from “Test tagging and selective execution across large suites” in a small script or note.