【发布时间】:2020-06-28 04:50:00
【问题描述】:
我在网站https://www.qatestpage.com/page1
点击'testlink'后
新窗口https://google.com 已打开。
我想断言新窗口的 url 是正确的。
这是我的代码:
cy.get('a[href*="testlink"]').eq(0).click()
cy.location().should((loc) => {
expect(loc.href).to.include('https://google.com')
})
错误:
Timed out retrying: expected 'https://www.qatestpage.com/page1' to include 'https://google.com'
【问题讨论】:
标签: cypress