test fixes

This commit is contained in:
sebv
2014-05-30 14:02:56 +08:00
parent 5ec2fab8bf
commit 789d360194
2 changed files with 9 additions and 6 deletions
+8 -6
View File
@@ -81,19 +81,21 @@ module.exports.initSession = function (desired, opts) {
});
}
deferred.resolve(browser);
var caps = _.defaults(desired, env.CAPS);
var caps = _.clone(desired);
_.defaults(caps, env.CAPS);
if (env.SAUCE) {
if (env.TRAVIS_JOB_NUMBER) name = '[' + env.TRAVIS_JOB_NUMBER + '] ' + name;
if (name) desired.name = name.replace(/@[^\s]*/,'');
if (env.TRAVIS_BUILD_NUMBER) desired.build = env.TRAVIS_BUILD_NUMBER;
if (name) caps.name = name.replace(/@[^\s]*/,'');
if (env.TRAVIS_BUILD_NUMBER) caps.build = env.TRAVIS_BUILD_NUMBER;
if (opts['expect-error']){
caps.tags.push('expect-error');
}
caps['max-duration'] = 600;
if (caps['appium-version']){
// locking cap list
caps['appium-version']['filter-caps'] = _(caps).keys();
}
if (opts['expect-error']){
caps.tags.push('expect-error');
}
}
if (env.VERBOSE) console.log("caps -->", caps);
+1
View File
@@ -35,6 +35,7 @@ var loadWebView = function (desired, browser, urlToLoad, titleToSpin) {
if (_.contains(["safari", "iwebview", "chrome", "chromium", "chromebeta"], app)) {
return browser
.get(urlToLoad)
.sleep(1000)
.then(function () { return spinTitle(titleToSpin, browser); });
} else {
return browser