Skip to content

Document @alias.all and @alias.2 #1573

Open
@jennifer-shehane

Description

@jennifer-shehane

I'm submitting a...

[ ] Bug report 
[x] Content update
[ ] Process update (build, deployment, ... )

Type of bug / changes

We should document the use of @alias.all and @alias.2 within a couple of documents:

When referencing aliases, you can reference @alias.all or @alias.2 and it will return respectively all of the aliases of that name or the 2nd request matching the name.

Examples:

it("does not poll for list again", function() {
  cy.wait("@getList");
  cy.tick(10000);
  // does not poll for another request
  cy.get("@getList.all").should("have.length", 1);
});
it("first request has correct data", function() {
  cy.route({
    url: 'users',
    response: 'fx:users'
  }).as("getUsers");
  cy.visit("/users");
  cy.get("@getUsers.1").then((xhr) => {
    expect(xhr.url).to.include("page=1"))
  })
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions