admin管理员组文章数量:1331849
How to I check that the length of text of an element is greater than 0 in nightwatch?
I want to check the length of text of an element on a page to make sure it is greater than 0 using nightwatch.
How to I check that the length of text of an element is greater than 0 in nightwatch?
I want to check the length of text of an element on a page to make sure it is greater than 0 using nightwatch.
Share Improve this question edited Oct 17, 2018 at 11:41 Bárbara Peres 5951 gold badge9 silver badges26 bronze badges asked Mar 18, 2016 at 0:49 Brown ABrown A 9795 gold badges14 silver badges22 bronze badges1 Answer
Reset to default 9You can make your own custom mand that uses browser.assert.
module.exports = {
'Length of text should be greater zero': function(browser) {
browser
.url('..')
.getText('#some-selector', function(result) {
browser.assert.ok(result.value.length > 0);
})
.end();
}
};
本文标签:
版权声明:本文标题:javascript - How to I check that the length of text of an element is greater than 0 in nightwatch? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742224471a2435891.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论