https://cypress.io logo
So we've had a race condition in our test initiali...
# e2e-testing
p
So we've had a race condition in our test initialization that has been stopping us from upgrading past cypress 9 for months. We have a helper function called
setupGameAsP0()
which is a regular js function that calls several custom cypress commands including creating multiple accounts and making a game. Someone tried wrapping the beginning of the function in
cy.then()
and it suddenly works, to my bewilderment. Can anyone help me make sense of this? We now have
Copy code
cy.then(() => { // we added this wrapping cy.then()
    if (!alreadyAuthenticated) {
      cy.wipeDatabase();
      cy.visit('/');
      cy.signupPlayer(username, validPassword);
    }
  });
and suddenly the tests pass in CI
2 Views