As of February 6th, Cypress is now a cross-browser testing tool!! Firefox support has been under development for the best part of two years now whilst support for Edge happened as a result of the new release of the browser.
As with any major release, or sometimes minor (I’m looking at you 3.5.0 😒), there will be breaking changes.
Browsers ignore leading, trailing and duplicate whitespaces. And Cypress now does that, too.
// This should now pass in version 4+ cy.get('p').contains('Hello, World') // This should now fail in version 4+ cy.get('p').contains('Hello,\nWorld')
The minimum version for Node has been bumped up to 8+, however, you should already be at least on the latest LTS version.
Some of the underlying dependencies that Cypress uses has also been upgraded. As you can see below, the difference in versions are big, expect some API changes.
|Name||Version Before||Version After|
done() callback and returning a promise in test will result in an error. This error originates from Mocha itself.
4.2.0 brings some breaking changes for some assertions.
Assertions that expect numbers will cause them to fail if non-numbers are passed in.
// This will fail expect('text').to.be.above(5)
Non-existent properties will also now appear as failures.
// Previously, this will pass. // However, if you were using TypeScript this should not happen. expect(true).to.be.ture
Stubbing a non-existent properties of an object will cause the test to fail.
reset() methods for stubs and spies have been renamed to
const spy = cy.spy() const stub = cy.stub() spy.resetHistory() stub.resetHistory()
If you still haven’t tried Cypress yet, here’s a post I wrote that should hopefully help you through.