Who has experience with Cypress as a Selenium replacement?

(Dirk) #1

Yesterday I had a demo of Cypress. I was very impressed, and had much fun playing around with it. Cypress claims to solve the problems of brittle and flaky test automation.

I know it is still in closed beta, so maybe not many people have tried it yet. But who has and can tell me a bit more about the benefits and drawbacks in real-life situations?

(Of course I’m willing to share my (very limited) experience too if people are interested/curious.)

Automation - question on using Selenium with E2E testing
(Butch Mayhew) #2

I haven’t used Cypress yet. Looks like it is a really slick interface. Signed up for pre-beta access. I would be curious to see how/if Cypress can manage test data. This was one of our biggest problems we faced when implementing automation. One notable difference is Cypress looks like a framework that runs your tests while Selenium is more of an API that allows you to drive the website. You still need a testing framework to run the test and other tools to make selenium easy to use.

(Dirk) #3

You can run the tests either from the Cypress desktop app or include them in your build process (took us 30 minutes to set up).
We set up a couple of tests now, and will monitor in the upcoming weeks how they help or hinder us.

(Viktoriano) #4

I haven’t used it yet also but it looks promising. I was trying to find what languages it supports but as I understood that it’s JavaScript only.

That’s not good for me because I don’t know JavaScipt, so I will not be able to switch to Cypress.

(Dirk) #5

I myself have hardly any programming experience, and even I got this up and running. There are many examples in their documentation, that you can just copy-paste and modify. So I wouldn’t let lack of JavaScript knowledge stand in your way.
Here is an example of one of my tests (surely you can go a lot deeper and I intend to do so later):

This is a fixed format, you could happily work with this by just replacing the lines starting with ‘cy.’ and not knowing anything about how to write functions in JavaScript. All the functions I used were copy-pasted from their documentation.
The hardest thing for me was to get familiar with CSS-selectors.

(Loren) #6

Still using Cypress? Curious to hear if you’ve been able to add value to your test suites.

We’re about to add some proof of concept tests that will hopefully allow us to learn more about capabilities/limitations.

(Dirk) #7

Hi there! I switched projects, and my current project has limited use for end-to-end testing (since it is a minor application).
What I liked about it (from small proof of concepts):

  1. Transparency: you can play back the test, see where it failed (actually see, so including the screen it is on, where it tried to click, and why the clicking failed (for example: ‘found multiple elements with class xx so I don’t know which one to click’)

  2. Relative easy of use: I was new to both JavaScript selectors and Mocha, so I had a long learning curve ahead. But I could get up&running quite fast

  3. Integrated well with our CI

  4. Runs very fast.

Downsides I experienced:

  1. I had frequent crashes of Cypress itself. So while developing the tests, not while running them. I mentioned this on the Cypress-board, but it has not been addressed as fasr as I know.
  2. No cross-browser testing. IMHO this is not a big deal for our product, but with Cypress you can only test on Chrome and Elektron, not on IE, FF, etc. For some this might be a dealbreaker.

I would highly recommend you to do your experiments. Since it is low-cost to get started, I would see no reason not to.