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 @alias.all and @alias.2 #1573

Open
jennifer-shehane opened this Issue Apr 10, 2019 · 1 comment

Comments

2 participants
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Apr 10, 2019

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"))
  })
});
@clarmso

This comment has been minimized.

Copy link

clarmso commented Apr 13, 2019

There needs to be a discussion whether the use of alias.all and alias.[1-9][0-9]? should be documented or not. It sounds like this feature is unadvertised on purpose.
cypress-io/cypress#3929 (comment)

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.