【发布时间】:2021-06-16 12:47:38
【问题描述】:
我需要一种方法在代码 sn-p 下成功运行,但有任何异常
it("Visiting Google",function(){
var webUrl = 'https://html5test.com/'
cy.visit(webUrl)
var iterator = 1
while(iterator < 5)
{
const $select_element = cy.get('h1 > em')
if($select_element.contains('abcd'))
{
cy.log("string found")
}
else
{
cy.log('string not found')
break
}
iterator += 1
}
})
我需要这个测试用例来运行 while 循环,直到 while 中的条件失败,或者如果 case 条件失败并且控制进入 else 块
【问题讨论】:
标签: javascript jquery automation cypress