2015-05-03 3 views

ответ

4

Nightwatch.js расширяет Node.js assert module, поэтому вы также можете использовать любые доступные методы в своих тестах.

'some suite': function (client) { 

    client.execute(function(greet){ 
    return greet + " there!"; 
    }, "Hello", function(result){ 
    client.assert.equal(result, "Hello there!"); 
    }); 

}, 
+0

Лучший ответ, это спасло мой день (охотился в течение многих часов :-() – joy

0

Попробуйте с помощью следующего кода:

'some suite': function(client) { 
    client.execute(function(args) { 
     return args + ' there!'; 
    }, ['Hello'], function(result) { 
     client.assert.equal(result.value, "Hello there!"); 
    }); 
}, 
Смежные вопросы