0
我使用Nightwatch,Mocha和Should.js進行測試。 而在某些情況下,我會檢查元素的文本值。 我的問題是 - 如何使測試狀態 - 「失敗」,當文本值不等於預期值?如何返回測試狀態 - should.js「失敗」?
it("Test should return 'fail' status", function(client) {
client
.url(urlAddress)
.waitForElementPresent("h1", config.middleTimer)
.getText("h1", function(result) {
result.value.should.be.exactly("Expected text!!!");
})
.end()
});