Cypress

Cypress

DevOps / Build, Test, Deploy / Javascript Testing Framework
Needs advice
on
CypressCypress
and
NightwatchjsNightwatchjs

We are planning to switch to an automation tool as Protractor is not going to provide support.

Why does everyone prefer Cypress which is a paid tool if we have Nightwatchjs? Can someone help me understand which one to prefer with their advantages and disadvantages?

READ MORE
3 upvotes·19.2K views
Replies (2)
Strategic Success at Cypress.io·
Recommends
on
Cypress

This is a great question!

Cypress is an overall testing solution of which e2e is a subset of its capabilities. The Cypress App is free to use and completely open source it was built with a developer experience first focus and it was geared toward solving the problem of web application testing by running in the browser's process.

I often encounter in my work with organizations adopting new tools a framing of why should I choose X tool over Y tool. This is a great place to start thinking, but what I like to challenge organizations I work with is to take one step back and ask, " Am I looking for a tool or a solution?"

A tool works in conjunction with other tools to achieve some mostly singular purpose; unit testing, API testing, integration testing, component testing, e2e testing, contract testing, analytics, etc. Tools also require learning a new syntax, continual training, implementation time, on-going maintenance and more a conjunction of other tools to accomplish an overall solution, in this case effectively and confidently testing.

Cypress is an overall testing solution of which there are two core product areas (right now), The Cypress App & Dashboard. The Cypress App is a completely free open source project that can test anything that runs in the browser.

Features of Cypress App - absolutely free - #1 tool recommended by Angular and Protractor team for migrating to after the deprecation of Protractor - automatic retries and baked in tests for actionability on elements - running in the browser's process - can test the following; front end unit, component, integration, api, e2e testing - can test multi-origin (currently in beta) - amazing docs - syntax is straight forward - no complex configs or setup - thriving and vibrant community - bi-weekly release cycle, so always iterating and improving - integrates with the Dashboard to show information from your runs in the cloud

The Cypress Dashboard is a paid subscription service that well to put it briefly makes testing even better with a focus on;

  • speeding up your runs through parallelization
  • unlocking an enhanced debugging workflow
  • providing you analytics that help you better understand the ongoing health of your test suite
  • handling all of your Cypress testing types in one place
  • addressing flake through our flake analysis and mitigation workflows
  • integrates all CI providers, Slack, Jira, and the top source control management tools to report directly on your runs
  • and a lot more

I hope this was helpful for you and the team, but don't take my word for it come engage in our community forums on Discord and ask around.

https://discord.gg/RFyjB34h

Oh, and I almost forgot, our DX team built a free to use Protractor to Cypress migration tool that will help you swap your tests over to Cypress. It's a really great tool when you're getting started to learn more about Cypress syntax. Anything with a lot of complex logic may not migrate appropriately, but it should give you a running start!

https://migrator.cypress.io/

READ MORE
6 upvotes·196 views
Sr. QA Engineer at Exzeo Software Pvt Ltd·
Recommends
on
Cypress

Cypress tests are always fast in execution as compared to tools that use selenium. Cypress also operates at the network layer so you don't need to install any external libraries. Cypress tests are easy to set up and you don't need any browser drivers to run cypress tests. Any browser that is installed, you can run cypress tests on those browsers. It is very easy to write locators and tests in cypress as compared to any other tool. The only drawback of cypress is it doesn't handle subdomain change and multiple tabs. But there are workaround for subdomain change that one can use

READ MORE
4 upvotes·215 views
Chief Product Officer at InfoDesk·
Needs advice
on
CypressCypress
and
Robot FrameworkRobot Framework

In which situations should we use Cypress or Robot Framework? Are both good choices to get tenured manual testers into the practice of automating their work for tests of APIs and functional tests of web applications? Cypress looks great for functional testing of web applications and Robot Framework looks great for everything else.

Background: We have over a thousand functional test cases for our web applications being executed manually by a QA team. Our front ends interface with APIs written in Java with various frameworks over the years (e.g. Spring, Spring Boot, Java EE). I think our testers could learn enough of the basic coding in JS, Java, and Python required to automate most of those cases.

READ MORE
5 upvotes·76.6K views
Needs advice
on
CypressCypress
and
ProtractorProtractor

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·22K views
Tech Lead at KIOT Innovations·
Needs advice
on
CypressCypress
and
ProtractorProtractor
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·861.6K 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·3.2K 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
on
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·337 views
Needs advice
on
CypressCypressTestCafeTestCafe
and
WebdriverIOWebdriverIO

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·169.1K views
Replies (1)
Recommends
on
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.8K views
testmanager/automation tester at medicalservice·
Needs advice
on
CypressCypress
and
ProtractorProtractor

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·261K views
Replies (2)
QE Systems Engineer at Discovery, Inc.·
Recommends
on
Cypress
Protractor

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·159.7K 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·188.5K views
Shared insights
on
CypressCypressJestJest

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·814.9K 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·3.9M views