简体   繁体   English

超过“8710ms”的赛普拉斯命令超时

[英]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但是一旦在8秒后执行完成,通过的测试又回到失败,原因如下

"Cypress command timeout of '8710ms' exceeded." “超过 '8710ms' 的赛普拉斯命令超时。”

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.赛普拉斯警告:赛普拉斯检测到您在测试中返回了 promise,但还在该 promise 内部调用了一个或多个 cy 命令。

The test title was:考试题目是:

Cics Switch Test Suite Default CICS Switch Tenant License Value Cics Switch 测试套件默认 CICS Switch 租户许可证值

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.您几乎不需要同时返回 promise 并调用 cy 命令。

Cy commands themselves already promise like, and you can likely avoid the use of the separate Promise. Cy 命令本身已经像 promise 一样,您可以避免使用单独的 Promise。

This is my it block code这是我的it块代码

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

As cy commands already handle the promises.由于cy命令已经处理了这些承诺。

it will work if you remove the async command in your it block.如果您删除it块中的async命令,它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM