您好我有以下简单的夜间游戏演示脚本,当使用多个浏览器环境运行时循环播放,但如果我使用单个浏览器运行测试,工作正常。< / p>
以下参数循环测试: 以下工作正常: 以下是我的代码,请让我知道我在这里做错了什么。 nightwatchgoogletest.js : 并编写了以下节点脚本来调用上面的测试: 使用以下夜间配置配置:
http://www.jsoneditoronline.org/?id=7e8e1616d595417ceeafaccc6358b33d 但是当我运行测试时,它会进入无限测试循环,如下所示: var argv = {
test: 'nightwatchgoogletest.js',
config: 'nightwatch.json',
reporter: 'junit',
env : 'default,chrome'
};
var argv = {
test: 'nightwatchgoogletest.js',
config: 'nightwatch.json',
reporter: 'junit',
env : 'chrome' (or default or any single browser)
};
module.exports = {
'Demo test Google' : function (client) {
client
.url('http://google.no')
.pause(1000);
// expect element to be present in 1000ms
client.expect.element('body').to.be.present.before(1000);
// expect element <#lst-ib> to have css property 'display'
client.expect.element('#lst-ib').to.have.css('display');
// expect element to have attribute 'class' which contains text 'vasq'
client.expect.element('body').to.have.attribute('class').which.contains('vasq');
// expect element <#lst-ib> to be an input tag
client.expect.element('#lst-ib').to.be.an('input');
// expect element <#lst-ib> to be visible
client.expect.element('#lst-ib').to.be.visible;
client.end();
}
};
var Nightwatch = require('nightwatch');
function proceess_test() {
try {
var argv = {
test: 'nightwatchgoogletest.js',
config: 'nightwatch.json',
reporter: 'junit',
env : 'default,chrome'
};
console.log("\n>> Initiating Tests for ...",process.env.__NIGHTWATCH_ENV_KEY);
var settings = {};
var done = function() {console.log("done")};
Nightwatch.runner(argv, done, settings);
done();
} catch (error) {
console.log('Exception: ' + error.message);
}
}
proceess_test();