-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Indicate when XHR's match aliases multiple times, and correlate those to waits #477
Comments
Any news on this one? There's a circumstance where I need to actually check if the same XHR gets requested N times, so I'm encountering this issue. |
Hi @brian-mann, any progress with this issue? |
@bsmithEG There actually is an undocumented way to check the number of times an XHR was responsed to using cy.wait('@getRuns')
cy.tick(10000)
// should have done 2 request responses, and definitely not 3
cy.get('@getRuns.all').should('have.length', 2) |
Played around with UI options a bit, would love any opinions. @jennifer-shehane @chrisbreiding |
/cc @brian-mann ^ I like the ordinal version. For the stub itself, I like only having |
I think that the numbers by themselves is a bit tricky because it's so close to the stylings for when we print the number of elements found for a command. But I also think that the ordinal numbers are very English-centric, as ordinals are printed differently in each language. They also take up more room, which is a negative. I would also make sure that you take into account there being 3 digit numbers - someone will have 100+ requests Maybe an alternative would be to write the number beside the printed alias...so:
|
@jennifer-shehane if you can experiment with some of the designs... I'm kind of thinking of something like this... I think we should connect the "number" with the alias, and tweak the tooltip messaging. Offering a "(?)" link next to alias also might be a good idea to help communicate how this actually works. |
Just like how counting the DOM elements works, I don't think we need to include anything if the event happens once, but do include the numbering for every subsequent event. |
PR'd in #2960, screenshots of that below. One topic I'm not sure on:
Some topics we discussed but I didn't implement:
A couple of different scenarios with aliases: |
The code for this is complete, but not yet released. It will be released in 3.3.0. At that time, we'll post a new message referencing the changelog. |
* Update alias UI (cypress-io#2960) - Fixes cypress-io#477 * fix reporter fixture name
Released in |
This is just what I need, but I can't find anything in the docs. |
Graphql only has a single endpoint so we have cases where we load the same URI multiple times on the page. I don't see any suggestions on how to wait for a variable number of requests in the docs. I would love a way to wait for all routes of a certain alias to finish, such as #3308 has some suggestions but doesn't work in this case |
Current behavior:
There's not an easy to know or correlate multiple matched XHR aliases to knowing how to wait for them.
Here's an example screenshot:
The problem is that the user is trying to wait on the 2nd XHR. But since they've only added a single
cy.wait("@getTable")
Cypress only waited on the first XHR to resolve.Desired behavior:
When an XHR matches an alias multiple times we should add a number indicator next to it...
So then when adding code like:
The command log would actually look like:
The text was updated successfully, but these errors were encountered: