It’s got a lot of frustrating edge cases and problems that mean your tests will always be brittle and break. A short list of the issues I’ve personally found is:
- they invented their own non compliant promises spec that means you can’t use async functions or methods.
- the 1st party xpath plug-in is not fully implemented and fails to have a sub selector (get xpath in this element).
- the runner doesn’t support individual tests in the ui, only test groups
- the plug-in ecosystem is weak, and many plugins only work with “happy path” scenarios, meaning you have to fork them to fix bugs
- you can’t catch a failed promise and try something else (see stupid promises implementation) meaning it’s always a hack to have a fallback test
- I can’t even begin to describe how frustrating the ‘.wrap()’ api is. The people who wrote this used jquery as their programming model, and it shows. Every object gets a magical wrapper to use the magical cypress functions, but promises sometimes return objects not wrapped objects. Your code starts looking very familiar if you alias “cy.wrap” to “$”.
It’s pretty, it’s smooth for trivial tests. …but do you need trivial tests?
Probably, you don’t need trivial tests. For trivial things, you can use unit tests.
Cypress makes it easier to throw away your tests and write them again than it does to maintain the ones you have.
(Prefer other types of tests whenever possible, but if you really do need drive-the-entire-browser E2E tests, use Playwright[1]. It's years ahead of Cypress.)
I can’t be clearer than that.
It’s got a lot of frustrating edge cases and problems that mean your tests will always be brittle and break. A short list of the issues I’ve personally found is:
- they invented their own non compliant promises spec that means you can’t use async functions or methods.
- the 1st party xpath plug-in is not fully implemented and fails to have a sub selector (get xpath in this element).
- the runner doesn’t support individual tests in the ui, only test groups
- the plug-in ecosystem is weak, and many plugins only work with “happy path” scenarios, meaning you have to fork them to fix bugs
- you can’t catch a failed promise and try something else (see stupid promises implementation) meaning it’s always a hack to have a fallback test
- I can’t even begin to describe how frustrating the ‘.wrap()’ api is. The people who wrote this used jquery as their programming model, and it shows. Every object gets a magical wrapper to use the magical cypress functions, but promises sometimes return objects not wrapped objects. Your code starts looking very familiar if you alias “cy.wrap” to “$”.
It’s pretty, it’s smooth for trivial tests. …but do you need trivial tests?
Probably, you don’t need trivial tests. For trivial things, you can use unit tests.
Cypress makes it easier to throw away your tests and write them again than it does to maintain the ones you have.