https://cypress.io logo
Does that mean I need to nest the subsequent `cy.m...
# best-practices
p
Does that mean I need to nest the subsequent
cy.myCustomApiCommand()
calls inside deeper
.then()
's to ensure that I have a closure with all of them? Or can I leverage
Promise.all()
even if it doesn't ensure the correct return value like:
Copy code
it('my test', function () {
  Promise.all([
    cy.myCustomApiCommand('user1').as('user1Id'),
    cy.myCustomApiCommand('user2').as('user2Id'),
  ]).then(() => {
    const myNewFixture = {
      user1: this.user1Id,
      user2: this.user2Id
    };
  });
});