Live TAT – Answering Questions from the MTC 2023 Code Battle: Cypress vs. Playwright – Part 1

This page was machine-translated from Portuguese and may contain mistakes. Read the original

On August 15, 2023, I appeared on the Talking About Testing livestream alongside Walmyr Filho, answering questions about the “Code Battle: Cypress vs. Playwright” event that took place on July 22 as part of the Minas Testing Conference 2023.

Here’s the link to the livestream: YouTube @TalkingAboutTesting

Check out the answers about Playwright below:

1. Can you run multiple test scenarios in parallel within the same test file in both Cypress and Playwright?

[Playwright] Renata: Yes. Playwright supports test parallelism by default using the "fullyParallel" and "workers" settings in the configuration file. 

It also has a sharding feature for pipelines
: https://playwright.dev/docs/test-sharding#sharding-tests-between-multiple-machines

Recommended related articles (Playwright):

2. Can PW or CY run performance tests?

[Playwright] Renata: Not by default, but you can implement it using the capabilities it offers. To evaluate the results, you’d need to integrate with k6, for example.
Here’s a video by John Hill, who works at NASA, explaining this: https://youtu.be/IrK-XDH72bw?t=1480 (and in this video, he mentions that you can do the same with Cypress).

3. As engineers, what advice do you have for us on learning more complex test architectures?

[Playwright] Renata: It depends on the project, the tech stack, and the size of the team.
I tend to use something similar to this architecture from the Advanced Playwright course: https://github.com/raptatinha/tau-advanced-playwright
Keep in mind that this isn’t a complete or refined architecture, since the course is educational and covers several standalone examples. In a real-world project, several factors must be taken into account.

4. Renata, does Playwright have a retry feature for tests in case of failure?

[Playwright] Renata: Yes. It’s right in the configuration file (it’s already there when you install it; you can change the values). It’s worth noting here that this feature works in tandem with the trace viewer.

5. I really liked it, but which languages do these frameworks work well with?

[Playwright] Renata: TypeScript and JavaScript are the development team’s top priorities since most of their market is Node.js.
Python, Java, and .NET—in that order—are the others. Even for those using .NET, Playwright offers significant advantages compared to other frameworks. Here’s an interview discussing a migration from Selenium to Playwright: https://testingwithrenata.com/blog/test-automation/playwright/tech-chat-migracao-para-playwright-de-selenium-com-bruna-e-albino/

6. Does Cypress support mobile testing?

[Playwright] Renata: Playwright emulates mobile browsers and has an experimental feature for testing Android apps (including Chrome for Android and Android WebView): https://playwright.dev/docs/api/class-android

7. Regarding design patterns, which has the better pattern—Cypress or Playwright? I know Cypress doesn’t use Page Objects; I think it uses a pattern created by the framework itself, whereas with Playwright, I’m not sure which pattern it uses.

[Playwright] Renata: The framework generally doesn’t dictate which pattern you use. You can use Playwright with or without Page Objects, just like Cypress. And there’s no “best framework overall”—there’s just the framework that’s best suited to your needs and the characteristics of your project.


We’ll have the second part of the live stream answering the remaining questions on September 26, 2023.
Don’t miss it!