以下脚本有效,但是,当一个测试发生错误时,它似乎也会导致所有其他测试失败。您是如何做到的,以便它们彼此独立运行?
var combos = [
['Windows 7', 'firefox'],
['Windows 7', 'chrome'],
['Windows 7', 'iexplore'],
['Windows 7', 'opera'],
['Windows 8', 'firefox'],
['Windows 8', 'chrome'],
['Windows 8', 'iexplore'],
['Windows 8', 'opera']
];
combos.forEach(function(currentValue) {
var options = {
desiredCapabilities: {
browserName: currentValue[1],
platform: currentValue[0]
},
host: 'ondemand.saucelabs.com',
port: 80,
user: [redacted],
key: [redacted],
logLevel: "verbose"
};
var webdriverio = require('webdriverio');
var client = webdriverio
.remote(options)
.init()
.url('http://google.com')
...
});