From the course: Learning Playwright
What is Playwright, and why choose it?
From the course: Learning Playwright
What is Playwright, and why choose it?
- [Instructor] So, you decided to go for it. You've made the right choice. Now it's time to start our learning journey together. Let's first begin by defining Playwright. Playwright is an open-source tool built by Microsoft that enables reliable end-to-end UI and API automation testing for modern web apps. This tool is gaining a lot of traction by providing a ton of value to companies as a leading choice within the test automation tooling. Playwright provides access to multiple browsers, which include Chromium, Chrome, Microsoft Edge, Firefox, Webkit, which is what Safari is built from. Every Playwright release will have a set version of each of these browsers bundled when installing Playwright. Let's take a look deeper into what makes Playwright special. It's highly rated on GitHub, currently over 66,000 stars at the time of this recording. They release new features around once a month. They support TypeScript, JavaScript, Python, .NET and Java officially, but there's also a Ruby and Go Community version. TypeScript is where we will focus in this course. Playwright is closer to Selenium WebDriver than Cypress. Why? It's an out-of-process automation driver that is not limited by the scope of in-page JavaScript execution. This is one of the Cypress limitations. Playwright, on the other hand, drives the browser that's being used from the outside like Selenium WebDriver, rather than being baked into the browser. Playwright can be used as a library or as a test framework. This course will be focusing on covering the Playwright Test framework specifically. So, what exactly is Playwright Test? Playwright Test has a built-in test runner that's very similar to Jest. This allows you to build out test steps using Playwright-specific syntax. Playwright Test allows you to run all your tests in parallel with no cost restrictions. It also allows you to run X amount of retries. Playwright Test shines the brightest with the ability to utilize built-in reporters to view detailed test runs, screenshots, videos, and trace files that show the exact state of the browser was in when the test was running. There's also a helpful VS Code extension that allows you to build, maintain, and debug tests all from within VS Code. So, this begs the question, why choose Playwright rather than some other tool? Well, the ability to run API and UI regression tests in the same framework was a big factor in my decision. I found developers and testers using one framework for both of these types of tests is a big benefit. We've mentioned some of the rich reporting and ability to run tests in parallel. This is only a portion of the built-in functionality that Playwright provides. There's excellent error handling. When a Playwright test fails, it's always super clear what the problem is from the error message. Not all tools have error messages as helpful as Playwright. The ability to configure projects in many different ways is also a game-changer when it comes to the flexibility Playwright offers. Playwright locators also have built-in auto-waiting and retry abilities. In the end, the reason why you should choose Playwright? Using Playwright for regression testing can give you confidence in future software releases. This is the point. We want to ensure we have high-quality releases, and Playwright is a great tool to help solve that problem.