我有一个场景,元素中的文本字符串可能是“队列中存在值”或“值不存在”
所以我想使用应该断言来确保两者的任何字符串都正确渲染。
我正在尝试这些选项,但不起作用
cy.get("Attribute").should('include', 'Value exist in Queue' || 'Value doesn't exist')
有什么工作可以解决这种情况吗?
将
match
与匹配任一字符串的正则表达式一起使用。
cy.get("Attribute").should('match', /Value exist in Queue|Value doesn't exist/)