Skip to content

Indicate when XHR's match aliases multiple times, and correlate those to waits #477

Closed
@brian-mann

Description

@brian-mann
Member

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:

zone_single_modal_edit_name_spec js-1

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...

(XHR) /getTable @getTable
(XHR) /getTable @getTable.2
(XHR) /getTable @getTable.3

So then when adding code like:

cy
.wait("@getTable")
.wait("@getTable")
.wait("@getTable")

The command log would actually look like:

WAIT @getTable
WAIT @getTable.2
WAIT @getTable.3

Activity

bsmithEG

bsmithEG commented on May 26, 2018

@bsmithEG

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.

itaykotler-fundbox

itaykotler-fundbox commented on Aug 8, 2018

@itaykotler-fundbox

Hi @brian-mann, any progress with this issue?

jennifer-shehane

jennifer-shehane commented on Aug 13, 2018

@jennifer-shehane
Member

@bsmithEG There actually is an undocumented way to check the number of times an XHR was responsed to using .all on the alias.

cy.wait('@getRuns')
cy.tick(10000)
// should have done 2 request responses, and definitely not 3
cy.get('@getRuns.all').should('have.length', 2)
added
type: duplicateThis issue or pull request already exists
and removed
pkg/driverThis is due to an issue in the packages/driver directory
on Dec 3, 2018
added this to the Sprint 14 milestone on Dec 3, 2018

32 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @strass@chrisbreiding@brian-mann@jennifer-shehane@lilaconlee

      Issue actions

        Indicate when XHR's match aliases multiple times, and correlate those to waits · Issue #477 · cypress-io/cypress