playwright/docs/why-playwright.md
2020-08-28 09:38:12 -07:00

3.4 KiB

Why Playwright?

Playwright enables fast, reliable and capable automation across all modern browsers. This guide covers those key differentiators to help you decide on the right tool for your automated tests.

Support for all browsers

  • Test on Chromium, Firefox and WebKit. Playwright has full API coverage for all modern browsers, including Google Chrome and Microsoft Edge (with Chromium), Apple Safari (with WebKit) and Mozilla Firefox.

  • Cross-platform WebKit testing. With Playwright, test how your app behaves in Apple Safari with WebKit builds for Windows, Linux and macOS. Test locally and on CI.

  • Test for mobile. Use device emulation to test your responsive web apps in mobile web browsers.

  • Headless and headful. Headless and headful automation is supported across all browsers and on all platforms.

Fast and reliable execution

  • Auto-wait APIs. Playwright interactions auto-wait for elements to be ready. This improves reliability and simplifies test authoring.

  • Timeout-free automation. Playwright receives browser signals, like network requests, page navigations and page load events to eliminate the need for sleep timeouts that cause flakiness.

  • Lean parallelization with browser contexts. Reuse a single browser instance for multiple parallelized, isolated execution environments with browser contexts.

  • Resilient element selectors. Playwright can rely on user-facing strings, like text content and accessibility labels to select elements. These strings are more resilient than selectors tightly-coupled to the DOM structure.

Powerful automation capabilities

Integrates with your workflow

  • One-line installation. Running npm i playwright auto-downloads browser dependencies for your team to be onboarded quickly.

  • TypeScript support. Playwright ships with built-in types for auto-completion and other benefits.

  • Debugging tools. Playwright integrates with the editor debugger to

  • Language bindings. Playwright is also available in Python and C#.

  • Deploy tests to CI. First-party Docker image and GitHub Actions to deploy tests to your preferred CI/CD provider.