【发布时间】:2019-08-20 04:57:17
【问题描述】:
我想检查第二个 .item 元素是否包含一些文本
cy.get('.item').then(($items) => {
expect($items).to.have.length(2);
expect($items[1]).to.contain('Published');
});
cypress 抛出错误:TypeError: obj.is is not a function.
我也试过expect($items[1]).text.to.contain('Published');
这次错误是TypeError: Cannot read property 'contain' of undefined。
【问题讨论】:
标签: cypress