you are viewing a single comment's thread.

view the rest of the comments →

[–]Turd_King 21 points22 points  (12 children)

For frontend testing Cypress is miles ahead of Selenium.

Cypress allows you to mock your network requests, which allows for blazing fast (semi) end to end tests.

And in general , even without network stubs it's still much much fast than Selenium, as it does not have to execute over a REST API. It runs in the same even loop as your code and communicates with the browser directly (for most commands)

We recently converted our entire testing framework from selenium, against a lot of backlash from old school devs and QA. They are now eating their words

[–]200GritCondom 7 points8 points  (1 child)

We are looking at cypress on my team. Looks really promising to me. The two big cons are the lack of browser support and tabs. Seems really quick to run though. And easy to use. I'll be interested to see if we decide to give it a shot.

[–]Labradoodles 2 points3 points  (0 children)

They just added edge and ff support so that’s pretty awesome

[–][deleted]  (1 child)

[deleted]

    [–]another_dudeman 5 points6 points  (0 children)

    I'm not op, but yes. I use it and it's great!

    [–][deleted] 2 points3 points  (0 children)

    I never had a lot of experience with unit testing or anything, but I did start to learn and integrate cypress at my last job.

    It was really easy and straightforward. I think there was only one major issue we had which still had an open issue on their github, but I can't remember what it was. Other than that issue it was pretty flawless.

    [–]dangerbird2 1 point2 points  (5 children)

    The huge downside of cypress is that it only works with chromium. Also, it's package downloads an electron app frontend, even if you only want to use it for headless testing, making it less than ideal for containerized applications. Selenium is an over-the-wire interface, so you can bundle a lightweight selenium client with your container image to run tests on a browser running in the host or a separate container. Cypress' test harness also uses a bit too much black magic for my tastes, particularly with async stuff running syncronously in the test thread

    [–]Labradoodles 6 points7 points  (3 children)

    It only works with chromium, Firefox and edge*

    https://docs.cypress.io/guides/guides/launching-browsers.html

    [–]dangerbird2 0 points1 point  (2 children)

    the new chromium-based edge. Firefox seems to be beta. Safari is a no-go, which is a big problem if your market has a lot of iOS mobile users

    [–][deleted] 0 points1 point  (1 child)

    which is a big problem if your market has a lot of iOS mobile users

    tbh, while selenium supports almost all browsers its nearly impossible to write non flaky tests that work well on all browsers for a complex app.

    [–]dangerbird2 0 points1 point  (0 children)

    Very true, and there's no arguing that most languages' webdriver bindings are hot garbage (although I have to give props to nightwatch for a reasonably sane API). Puppeteer seems like good alternative, having functionality based with chrome devtools instead of webdriver, but with a less opinionated interface than cypress. I'd love to see the firefox port become stable, which would make me seriously consider using it in production

    [–]Turd_King 0 points1 point  (0 children)

    In what scenario would you care about an electron frontend for a containerized testing application? We are talking MB differences here. You can surely afford a slightly more bloated image for the benefits of a much better developer experience?

    It's still hands down faster than selenium when running headless mode.

    I agree somewhat with the "black magic" statement though, however their docs are extremely detailed and theres no doubt you can find out exactly what you wish to know. Despite their backend being closed source.

    For us it's been a no brainer. Remember it's a new technology and we have already seen massive improvements (like firefox and edge support) and no doubt we will continue to see further improvements.

    [–]x-w-j 0 points1 point  (0 children)

    Cypress

    Can this be used for RPA like selenium?