Open
Description
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:
- https://docs.cypress.io/guides/core-concepts/variables-and-aliases.html
- https://docs.cypress.io/api/commands/get.html#Alias
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"))
})
});