rackhwan
rackhwan

Reputation: 285

Cypress command timeout of '8710ms' exceeded

I have a test which is written in cypress and failed. The test execution is successfully completed and passed. But once the execution is completed after 8 seconds, the passed test is turning back to fail for the following reason

"Cypress command timeout of '8710ms' exceeded."

Console log

Cypress Warning: Cypress detected that you returned a promise in a test, but also invoked one or more cy commands inside of that promise.

The test title was:

Cics Switch Test Suite Default CICS Switch Tenant License Value

While this works in practice, it's often indicative of an anti-pattern. You almost never need to return both a promise and also invoke cy commands.

Cy commands themselves already promise like, and you can likely avoid the use of the separate Promise.

This is my it block code

it("Default CICS Switch Tenant License Value", async () => {
    loginPage.portalLogin(
      quickregisterPage.userInfo.emailAddress,
      quickregisterPage.userInfo.password
    );
    loginPage.logoDynatrace().should("be.visible");
    trialLicenceDetailsPage
      .getTrialLicenceDetailsPageTitle()
      .should("have.text", "Trial license details");      
  });

Upvotes: 0

Views: 1690

Answers (1)

user10251019
user10251019

Reputation:

As cy commands already handle the promises.

it will work if you remove the async command in your it block.

Upvotes: 4

Related Questions