- Weird nature of Cypress promises that aren't promises, are sometimes chained, and sometimes uses
.then
- Inability to use await/async
- Inability to use standard variables
- Getting values from the page is a pain
- Getting a URL
const href = await $('a').getAttribute('href');
- cy.get('a') .invoke('attr', 'href') .should('eq', 'https://docs.cypress.io') But not really because we can't use that elsewhere so need a better example
- Getting text: https://docs.cypress.io/faq/questions/using-cypress-faq#How-do-I-get-an-element-s-text-contents
VS
const text1 = await $('div').getText(); await $('button').click(); const text2 = await $('div').getText(); expect(text1).not.toEqual(text2);
- Getting values from the page is a pain
- Have to do
.then
just to do debugging - Can't
return
from custom commands - Retries only the last command, means chaining off of elements is discouraged, which limits abilities
- A lot of "You'd think this would work, but it actually doesn't b/c of X. Here's the actual way to do it"
- This results in code that's harder to read for anyone unfamiliar with the quirks of Cypress. (show example of custom command with 3 issues in it)
- A lot of time wasted debugging issues that shouldn't be issues, but actually are.
- Can't just log to the console!
- Assertions are a mixed bag between 'expect' and 'should' syntax.
- Documentation is frustrating https://docs.cypress.io/guides/references/assertions
- https://docs.cypress.io/api/commands/invoke#Properties-that-are-functions-are-invoked
Last active
July 13, 2022 23:08
-
-
Save klamping/20e6c77595b34c23688679935bbf90b0 to your computer and use it in GitHub Desktop.
Cypress Complaints
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment