如何在一个会话中测试两个网站

use*_*016 1 cypress

我们正在致力于多层服务驱动的项目。CRM驱动的UI项目用于设置规则引擎。(UI - 我们使用 Cypress.io 自动化此操作)

更改需要几分钟才能反映在面向最终用户的前端应用程序中(它也由 Cypress.io 框架单独涵盖)

We would like to have e2e UI tests, which starts first on Rules engine and same test should wait for few minutes & then continue to check the affect on Frontend UI

In selenium we could do something like -

driver.get("http://www.siteA.com/rules");//internal rules engine CRM
..
..    
driver.manage().timeouts().implicitlyWait(5, TimeUnit.MINUTES);
..
..
driver.get("http://www.siteB.com/public");//customer facing Frontend
Run Code Online (Sandbox Code Playgroud)

Is it possible to achieve something similar in Cypress.io

Thanks

Raf*_* C. 5

我为这个问题创建了一个解决方法,它对我来说效果很好。

当您想要在测试运行时导航到另一个 URL 时,请使用此代码:

cy.document().then((doc) => {
 doc.location.replace(newUrlHere)
})
Run Code Online (Sandbox Code Playgroud)