| |

Selenium to Playwright Migration Part 7: Quick Reference Card and Migration Checklist

This is part of the Selenium to Playwright Migration Series. Follow the complete 7-part tutorial to migrate your test suite from Selenium Java to Playwright TypeScript.


The one-page reference card for your Selenium to Playwright migration. Pin this to your desk, bookmark it, share it with your team.

Contents

The 10 Rules of Migration

  1. Delete all waits first — Playwright auto-waits for everything
  2. Replace XPath with semantic locators — getByRole, getByLabel, getByText
  3. Remove base classes — use Playwright fixtures instead
  4. Delete PageFactory — Playwright locators are lazy by default
  5. Convert Assert to expect() — auto-retry assertions are more reliable
  6. One config file replaces 5 — playwright.config.ts replaces testng.xml, listeners, properties
  7. Go bottom-up — Config, Utils, Pages, Modules, Tests, CI
  8. Run parallel from day one — fullyParallel: true in config
  9. Use .env for everything — no more Java properties files
  10. AI converts 80%, you validate 100% — never trust AI output without review

Migration Checklist

  • Project initialized with npm init playwright@latest
  • playwright.config.ts configured (parallel, retries, reporters)
  • .env file created with all environment variables
  • src/config/index.ts exports typed configuration
  • All Page Objects converted (no inheritance, semantic locators)
  • Module layer created for business flows
  • All tests converted to test() blocks with async/await
  • Zero WebDriverWait or Thread.sleep remaining
  • Zero XPath locators (replaced with getByRole/getByLabel)
  • GitHub Actions CI pipeline configured with sharding
  • All tests pass in headless mode
  • Trace and video configured for failure debugging
  • Old Selenium suite running in parallel (during transition)
  • Team trained on Playwright debugging (Trace Viewer, UI Mode)

Common Gotchas

GotchaSolution
Forgetting awaitTypeScript strict mode catches this. Enable "strict": true in tsconfig.json
Using CSS selectors for everythingPrefer getByRole/getByLabel. CSS selectors break when classes change
Creating wait helper classesDelete them. Use expect() with custom timeouts when needed
Extending a base classUse fixtures for shared setup. Composition over inheritance
Running tests sequentiallySet fullyParallel: true. Each test gets its own BrowserContext
Committing .env filesAdd .env to .gitignore. Use CI secrets for pipeline values

Estimated Timelines

Suite SizeTeam SizeTimelineEst. Cost
50 tests1 engineer3-4 weeksInternal
200 tests2 engineers2-3 months$20-30K
500 tests3 engineers3-6 months$50-80K
1000+ tests4+ engineers6-12 months$100K+

This completes the Selenium to Playwright Migration Series. Go back to Part 1 to start from the beginning, or bookmark any part for reference.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.