但是测试总是失败并显示消息:
Failed [equal]: ('' == 'This is a title ') - Expected "This is a title " but got: ""
测试编写如下:
browser.getText('.ui-visible .caption-expanded b',
function(result) {
this.assert.equal(result.value, 'This is a title ');
}
);
我也尝试过:
browser.expect.element('.ui-visible .caption-expanded b').text.to.equal('This is a title ');
两次尝试都以空字符串失败。我做错了吗?
答案 0 :(得分:-1)
我认为你可以这样做.assert.containsText('name_of_your_element', 'This is a title')