这是api client.execute.我能够获得一个值,但我怎么能够真正测试该值是否正确?我没有assert在任何地方看到通用方法.
Nightwatch.js扩展了Node.js断言模块,因此您还可以在测试中使用任何可用的方法.
'some suite': function (client) {
client.execute(
function(greet){
return greet + " there!";
},
"Hello",
function(result){
client.assert.equal(result, "Hello there!");
}
);
}
Run Code Online (Sandbox Code Playgroud)