A talk I gave at the enterJS 2022, introducing Playwright and dealing with the question, if Playwright could cause a change of the guard in the world of E2E testing.
Playwright: Middle way ● Outside browser testing ● Everything from one hand ○ Browsers, Testing Framework, Visual Regression ● Limited to CDP, incl. "Safari" ● Developer experience ● Access existing Selenium Grid via CDP ● Backed by Microsoft
Playwright's powerhorse: page.locator ● Returns a promise of a DOM query ● Chainable for actions ● Argument for assertions (expect) ● Different selectors (not just CSS) ○ Text selectors ○ Data-testid ○ Location-based ○ XPath ○ React/Vue experimental ● Nestable ● Shadow DOM "piercing"
Summary ✅ Out-of-browser testing without flakiness ✅ Young but already mature framework ✅ iOS & MacOS support on Windows or Linux ✅ Backed by Microsoft ✅ Powerful Traceviewer ⛔ Multiple support tools instead of central UI ⛔ Little IDE support (expect VSCode)