My favorite testing framework is ...
In this article, I will share why Playwright is my favorite testing framework. All options are good, and with more options, more improvements will come soon; competition is good to get more features soon.
I have experience with different testing frameworks:
Selenium/C#/BDD/Specflow
NightwactchJS
TestCafe/JS
Cypress/TS ⭐️
Playwright/TS/.Net ⭐️
Protractor as Proof of Concept (POC)
WebdriverIO/TS I helped some QA with complex and dynamic test cases.
And my favorites are:
Playwright/TS
Cypress/TS
I won a WebdriverIO book, "Enhanced Test Automation with WebdriverIO," so I can share my opinion after receiving and reading it.
Selenium still has a big market and is a good option for legacy, big, and stable projects. However, it took a lot of years (6 years) to include Cypress and Playwright's improvements since the first version.
We don't need to continue updating the Chrome web driver manually,
Mock APIs
Support for Chrome debugging Protocol,
The return of Selenium IDE to record and play the steps.
I saw the last Cypress conference, and in the previous months, it included some exciting options:
A puppeteer plugin
Test in Safari with Playwright plugin
Test iFrames and multiple windows.
Cypress Test Replay⭐️
I liked the Cypress Dashboard and will include more improvements in the subsequent releases. ⭐️
I like Cypress for its easy use, and Cypress Dashboard is very useful without manually getting the same results as more complex CI/CD and external reporting tools.
Things that I like
It includes the most valuable options without external plugins like Visual Testing, API Testing, Mock API, Multiple Windows, and iFrames.
It supports Webkit, Firefox, Edge, and Chrome, and with few exceptions, I didn't have to change the code for the different browsers.
The browser context allows tests to run in isolation super fast.
Easily reuse signed-in statements for users like admin, sales, and customer.
Includes parallel and shard testing
The reporting is very useful and easy to use. It includes visual testing, a trace viewer, screenshots, annotations, and video.
The code gen is handy and includes options to generate the assertions.
You can debug your tests in UI mode.
The fastest test execution may be relative, but some benchmarks and companies, such as Checkqly and QA Wolf, choose Playwright for its fast text execution and other reasons.
This is 100% biased because I am a big fan of Microsoft products. It is built and updated by Microsoft.
Stub and mock network requests with network interception.
The auto-wait mechanism is suitable, and it has the same POC as Playwright, Cypress, Testcafe, and Nighwatch. Playwright is better at breaking changes in the UI and business logic.
Multi-language: JS, TS, .Net, Python, Java.
Emulation for mobile devices, user agents, locales & time zones, permissions, geolocation, and dark/light mode.
The community support. You can get help in Discord. The Playwright ambassadors share some articles, videos, and training. You can report bugs in Github. Some bugs I registered were fixed, and others are still open, but I used another workaround.
Things that I don’t like
You need a lot of memory to perform well, especially in parallel testing. If not, the test starts to fail randomly.
Some features, like visual testing and HTML reporting, are available only in the JS/TS versions.
There are no options for seeing a trace viewer or HTML report in cloud services like Cypress Dashboard. Playwright Azure testing service is minimal and only shows the execution of the test without any detail.
So, in general, Playwright is an excellent tool, and this will be a great year for Playwright.
But remember: If you do not follow good testing practices, no testing tool will help you.