Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document retry-ability #1278

Closed
bahmutov opened this Issue Jan 3, 2019 · 2 comments

Comments

2 participants
@bahmutov
Copy link
Collaborator

bahmutov commented Jan 3, 2019

This is a key concept, yet we don't have a good single documentation place for it (something that on.cypress.io/retry-ability could refer to). So far we have two places

We need a section in the docs specifically about it, and how assertions that follow are retried, and even how to add it to your own custom commands and maybe even using cypress-pipe

https://glebbahmutov.com/blog/cypress-should-callback/#custom-commands-with-retry

@bahmutov bahmutov self-assigned this Jan 3, 2019

@jennifer-shehane

This comment has been minimized.

Copy link
Member

jennifer-shehane commented Jan 3, 2019

Yeah, I was thinking of this part of the docs: https://docs.cypress.io/guides/core-concepts/introduction-to-cypress.html#Commands-Run-Serially

Wherever the little sparkle emojis are I thought mentioned some of the retry behavior, but you're right.

@bahmutov

This comment has been minimized.

Copy link
Collaborator Author

bahmutov commented Jan 14, 2019

Yeah, that guide is ... long. I would think that just describing a few examples of built-in query commands like cy.get('.todo li').should('have.length', 2) would be enough. Because I see one other thing that people ask and suggest in Gitter - invoking method (which destroys retry-ability) to compute something of the element. Imagine element that keeps changing text for example. If users just do cy.get('div').invoke('text').should('equal', 'foo') they are not going to get the right result (maybe) because it will not get new element, only retry text() on the element it grabbed.

Actually I don't know what it would do in this case - invoke text() on each element returned from get('div')? or just the first one?

So I would think that most users might benefit from using should(cb) in this case, especially now that we have more should(cb) examples

@bahmutov bahmutov referenced this issue Jan 17, 2019

Merged

add doc page about retry-ability #1314

1 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.