Cypress

Cypress

DevOps / Build, Test, Deploy / Javascript Testing Framework
Shared insights
on
JestJestCypressCypress

As we all know testing is an important part of any application. To assist with our testing we are going to use both Cypress and Jest. We feel these tools complement each other and will help us get good coverage of our code. We will use Cypress for our end to end testing as we've found it quite user friendly. Jest will be used for our unit tests because we've seen how many larger companies use it with great success.

READ MORE
7 upvotes·430.5K views
Lead Architect at Fresha·

When you think about test automation, it’s crucial to make it everyone’s responsibility (not just QA Engineers'). We started with Selenium and Java, but with our platform revolving around Ruby, Elixir and JavaScript, QA Engineers were left alone to automate tests. Cypress was the answer, as we could switch to JS and simply involve more people from day one. There's a downside too, as it meant testing on Chrome only, but that was "good enough" for us + if really needed we can always cover some specific cases in a different way.

READ MORE
28 upvotes·1 comment·1.4M views
Anand Muley
Anand Muley
·
January 23rd 2020 at 5:23AM

Tech Stacks are going to evolve and be replaced. We will have to keep up with it. Never heard a Developer asking for such a responsibility shift to QA to fix a bug. I have spent some time in an Organization and a Project where test automation responsibility was bestowed upon Developers. It turned out that we did not need any automation QA skilled person we ended up replacing them with Manual QA skilled person. Lets not push our responsibilities to others. There is a reason for keeping a Developer and QA team separate. So that the quality checks are not compromised.

·
Reply
testmanager/automation tester at medicalservice·
Needs advice
on
ProtractorProtractor
and
CypressCypress

In the company I will be building test automation framework and my new company develops apps mainly using AngularJS/TypeScript. I was planning to build Protractor-Jasmine framework but a friend of mine told me about Cypress and heard that its users are very satisfied with it. I am trying to understand the capabilities of Cypress and as the final goal to differentiate these two tools. Can anyone advice me on this in a nutshell pls...

READ MORE
5 upvotes·178.9K views
Replies (2)
QE Systems Engineer at Discovery, Inc.·

I've used both Protractor and Cypress extensively. Cypress is the easier and more reliable tool, whereas Protractor is the more powerful tool. Your choice of tool should depend on your specific testing needs. Here are some advantages and disadvantages of each tool:

Cypress advantages:

  • Faster

  • More reliable (tends to throw fewer intermittent false failures)

  • Easier to read code (handles promises gracefully)

Cypress disadvantages:

  • Cannot switch between browser tabs

  • Cannot switch to iFrames

  • Cannot specify clicks or keypresses explicitly as if a real user was interacting

  • Cannot move the mouse to specific co-ordinates

  • Sometimes has trouble switching between different top-level domains, so not good for testing external links

  • Cypress is a newer tool with less extensive documentation and less community support

Protractor advantages:

  • More powerful because it is Selenium-based - it can switch between tabs, it can handle external links to other domains, it can handle iFrames, simulate keypresses and clicks, and move the mouse to specific co-ordinates within the browser.

  • More extensive community support and documentation

Protractor disadvantages:

  • Slower and more brittle - in general there is a higher likelihood of cryptic and/or intermittent errors which may cause your tests to fail even though there is nothing wrong with your application

  • For highly experienced automation engineers, the fundamental "brittle" nature of Selenium can be worked around - it can be reliable but only if you really know what you are doing

  • Less graceful handling of promises - relies on async/await or .then to manage the order of execution. Therefore it is a bit harder to read the code.

  • Harder to set up, and the method of setup impacts its reliability. For example, a hub/node configuration where the selenium jar is on a different physical machine than the browser under test will cause unreliability in your tests. Not everyone knows about this type of thing, so it's common to find Selenium frameworks that are set up poorly.

It's probably better to use Cypress if

  • you're at a smaller company and have a close relationship with developers who can help write hooks or stubs in their code to assist your testing

  • you don't need to do things like switch between tabs or test links to external top-level domains

It's probably better to use Protractor if

  • You might need to switch between tabs or test external links to other domains within the scope of your framework

  • You want to use a more accurate simulation of how a real user interacts with a browser (i.e. click at this location, type these keys)

  • You're at a company where you won't have any support from developers in writing hooks or stubs to make their code more testable in a less powerful framework like Cypress

READ MORE
4 upvotes·93.1K views
Web Engineer at sentaca·

Please try Handow, the e2e tool basing on Puppeteer.

Gherkin syntax compatible

Chrome/Chromium orentied, driven by Puppeteer engine

Complete JavaScript programming

Create test suites rapidly without coding (or a little bit), basing on built-in steps library

Schedule test with plans and arrange stories with sequential stages

Fast running, execute story groups in parallel by multi-workers

Built-in single page report render

Cover page view, REST API and cookies test

https://github.com/newlifewj/handow

http://demo.shm.handow.org/reports

READ MORE
1 upvote·121.9K views
Tech Lead at KIOT Innovations·
Needs advice
on
ProtractorProtractor
and
CypressCypress
in

Protractor or Cypress for ionic-angular?

We have a huge ionic-angular app with almost 100 pages and 10+ injectables. There are no tests written yet. Before we start, we need some suggestions about the framework. Would you suggest Cypress or Angular's Protractor with Jasmine / Karma for a heavy ionic app with Angular?

READ MORE
6 upvotes·98.4K views
Replies (2)

I work with two angular applications, one of them i already created a framework based on protractor. The other one i think using cypress instead of the protractor, the reason for that is the protrator will be deprecated at the end of the year. That reason for me is enough to select cypress as the better approach once it has a huge and increasing community and its downsides have been solved with time.

READ MORE
4 upvotes·4 comments·2.9K views
Sai Chaitanya Mankala
Sai Chaitanya Mankala
·
August 3rd 2021 at 12:47PM

Makes sense, thank you for your suggestion :)

·
Reply
Amir Rustamzadeh
Amir Rustamzadeh
·
August 3rd 2021 at 2:05PM

Hi Sai, Amir from the Cypress team here.

Angular team recently announced the deprecation of Protractor, so it's not a viable option for new projects or projects that have no tests.

Cypress can definitely help your team test your Ionic app, regardless of the size of the app. If you are using the Angular CLI, you can easily get started with the Cypress Angular Schematic: https://www.npmjs.com/package/@cypress/schematic

·
Reply
Tarunam Nair
Tarunam Nair
·
October 18th 2021 at 5:32AM

Please check Cypress limitations before investing in it. Look like cypress can't handle switching to multiple TABs, cross browser testing and switching to different domains.

·
Reply
Satish Javalekar
Satish Javalekar
·
January 6th 2022 at 7:34AM

cross-browser testing against 30+ browsers is possible with Cypress Automate through Browserstack

https://www.browserstack.com/automate/cypress?ref=guide-cypress-vs-selenium-floating-banner

https://www.browserstack.com/docs/automate/cypress.

Agree handling multiple tabs is not supported but there are work arounds

https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/testing-dom__tab-handling-links/cypress/integration/tab_handling_anchor_links_spec.js

Trade offs are clearly mentioned under cypress documentation https://docs.cypress.io/guides/references/trade-offs#Multiple-tabs

Hope this helps.

·
Reply
Software Engineer at EPAM Systems·
Recommends
Playwright
in

For end-2-end tests it's great - fast, working with or without headed mode, can do dom snapshots instead of only screenshots.

READ MORE
1 upvote·61 views
Needs advice
on
WebdriverIOWebdriverIOTestCafeTestCafe
and
CypressCypress

Hello, I am currently looking for a tool for automation tests in order to implement it into our CI/CD pipeline for both web development but also for Android and iOS. I considered Cypress but I need compatibility with Safari. I have knowledge of Java, C#, and JavaScript so the language isn't an issue. Also looked into Nightwatchjs and Puppeteer but found these 3 above more interesting.

My main concern is:

  • Browser support - Desktop - needs to support Google Chrome, Safari, Firefox and Microsoft Edge (minimum)
  • Browser support - Mobile - Safari and Chrome (minimum)
  • App - Android and iOS

If possible i would like to avoid using another tool for mobile (like Appium)

What do you use? What is the one you recommend (even another from the ones mentioned)

Thank you very much for your help!

READ MORE
5 upvotes·78.2K views
Replies (1)
Recommends
Cypress

Hello João Pires,

From my experience using API and Framework tests tools like Selenium Webdriver, CodeCeptJS, and Cypress I never ever see a unique test repository that can work over Web system and Native Mobile app. Many times, it is tried to use the same test suite to two kinds of app, a web, and native mobile app, and then the test flow is mapped using different selectors to both apps and conditional code are add growing the complexity of tests. Definitely, it is not a good practice.

I see great potential in using Cypress to modern web apps running on browsers to desktop or mobile. However, how your second point is to run on mobile browsers like Safari and Chrome may be a good approach will be using a service of Cross Browser as BrowserStack or SourceLabs.

It is important to have clear if is relevant run while tests to many browsers in the same platform. If the goal is to guarantee the e2e flow from an integrated environment, use the most popular browser to users can be enough. (ps: 80% of users use Chromer and just only 30% of users use Safari.)

From a Mobile perspective, I believe that today there are more efficient test approaches to guarantee the behaviors of the components of isolated way than using some technology base on Selenium. As per example an instrumentation-based API using Espresso. Just only using Appium for E2E critical scenarios.

READ MORE
4 upvotes·8.3K views
Needs advice
on
ProtractorProtractor
and
CypressCypress

Please let me know if Cypress test runner can be used for more than 500 tests as I will run the API test from the command line. Note that I will not use the Cypress dashboard, and I want to debug any failed test cases from the logs.

READ MORE
2 upvotes·7.9K views