When comparing Puppeteer vs Cypress, the Slant community recommends Cypress for most people. In the question“What are the best Javascript end-to-end testing tools?” Cypress is ranked 1st while Puppeteer is ranked 3rd. The most important reason people chose Cypress is:
You can edit your test code in the browser and instantly see it run as you change the code.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Works great with modern node.js features
Pro Runs a real browser
Unlike the other options here, this is a real browser, just without the GUI parts. This means the quality of the test is much higher, and lets you do things like save to PDF or images.
Pro Actively developed and promoted by Google
Pro Complete API for Chromium included
Chromium tests depend on the same API that Puppeteer gives you access to, so all the features are included
Pro Web UI to develop tests quickly
You can edit your test code in the browser and instantly see it run as you change the code.
Pro Easy to record a video
It can easily record a video so you can understand what happened when a test failed in your CI.
Pro Amazing dashboard to view reports and recordings
The Cypress dashboard allows you to see every run on a great UI linked to commits and gitflow.
Pro Cross Browser testing
https://docs.cypress.io/guides/guides/cross-browser-testing.html
Chrome
Firefox
Edge
Electron
Brave
Cons
Con Not good for Cross Browser Tests
Since it only tests via Chromium, it won't help you test inconsistencies between browsers like Edge or Safari. There are projects to get around this, but they aren't mature.
Con Doesn't support Safari
Con Single tab only
Does not and will not support multiple tabs or multiple simultaneous browsers.
See https://docs.cypress.io/guides/references/trade-offs.html#Permanent-trade-offs-1
Con Heavy in setup
Do not add Cypress in the main repo. Have a specific test repo for it or you will be sorry when the CI/CD flow takes 5-6 min longer every build due to installation time of Cypress.