Merge pull request #2987 from sebv/grace-delay

Disabled ios grace delay, simplified bootstrap
This commit is contained in:
seb vincent
2014-06-28 00:00:58 +08:00
7 changed files with 32 additions and 22 deletions

View File

@@ -71,7 +71,11 @@ module.exports = function (grunt) {
}
}
, jscs: {
src: '**/*.js',
src: [
'**/*.js', '!submodules/**', '!node_modules/**',
'!lib/server/static/**', '!lib/devices/firefoxos/atoms/*.js',
'!test/harmony/**/*.js', '!sample-code/examples/node/**/*-yiewd.js',
'!sample-code/apps/**', '!sample-code/examples/php/vendor/**'],
options: {
config: ".jscs.json"
}

View File

@@ -278,8 +278,8 @@ IOS.prototype.start = function (cb, onDie) {
this.installToRealDevice.bind(this),
this.startInstruments.bind(this),
this.onInstrumentsLaunch.bind(this),
this.configureBootstrap.bind(this),
this.setBundleId.bind(this),
this.setBootstrapConfig.bind(this),
this.setInitialOrientation.bind(this),
this.initAutoWebview.bind(this)
], function (err) {
@@ -338,9 +338,7 @@ IOS.prototype.startInstruments = function (cb) {
IOS.prototype.makeInstruments = function (cb) {
// at the moment all the logging in uiauto is at debug level
// TODO: be able to use info in appium-uiauto
prepareBootstrap({
verboseInstruments: logger.appiumLoglevel === 'debug'
}).then(
prepareBootstrap().then(
function (bootstrapPath) {
var instruments = new Instruments({
app: this.args.app || this.args.bundleId
@@ -410,12 +408,19 @@ IOS.prototype.setInitialOrientation = function (cb) {
}
};
IOS.prototype.setBootstrapConfig = function (cb) {
IOS.prototype.configureBootstrap = function (cb) {
logger.debug("Setting bootstrap config keys/values");
var autoAcceptAlerts = !(!this.args.autoAcceptAlerts || this.args.autoAcceptAlerts === 'false');
var cmd = "setBootstrapConfig: autoAcceptAlerts=" + autoAcceptAlerts;
var isVerbose = logger.appiumLoglevel === 'debug';
var cmd = '';
cmd += 'target = $.target();\n';
cmd += 'au = $;\n';
cmd += '$.isVerbose = ' + isVerbose + ';\n';
cmd += 'autoAcceptAlerts = ' + autoAcceptAlerts + ';\n';
// Not using uiauto grace period because of bug.
// cmd += '$.target().setTimeout(1);\n';
this.proxy(cmd, function (err) {
cb(err); // discard res
cb(err);
});
};

View File

@@ -117,14 +117,14 @@ Safari.prototype.setInitialOrientation = function (cb) {
this._setInitialOrientation(cb);
};
Safari.prototype._setBootstrapConfig = IOS.prototype.setBootstrapConfig;
Safari.prototype.setBootstrapConfig = function (cb) {
Safari.prototype._configureBootstrap = IOS.prototype.configureBootstrap;
Safari.prototype.configureBootstrap = function (cb) {
if (this.args.udid) {
logger.debug("Not setting bootstrap config because we're on " +
"SafariLauncher");
return cb();
}
this._setBootstrapConfig(cb);
this._configureBootstrap(cb);
};
Safari.prototype.installToRealDevice = function (cb) {

View File

@@ -44,7 +44,7 @@
"appium-adb": "~1.3.0",
"appium-atoms": "~0.0.5",
"appium-instruments": "~1.2.0",
"appium-uiauto": "~1.3.0",
"appium-uiauto": "~1.4.0",
"argparse": "~0.1.15",
"async": "~0.9.0",
"binary-cookies": "~0.1.1",

View File

@@ -27,13 +27,13 @@ describe('webview - basics', function () {
});
it('getting list multiple times should not crash appium', function (done) {
driver
.contexts().should.eventually.have.length.above(1)
.contexts().should.eventually.have.length.above(1)
.contexts().should.eventually.have.length.above(1)
.contexts().should.eventually.have.length.above(1)
.contexts().should.eventually.have.length.above(1)
.contexts().should.eventually.have.length.above(1)
.contexts().should.eventually.have.length.above(1)
.contexts().should.eventually.have.length.above(0)
.contexts().should.eventually.have.length.above(0)
.contexts().should.eventually.have.length.above(0)
.contexts().should.eventually.have.length.above(0)
.contexts().should.eventually.have.length.above(0)
.contexts().should.eventually.have.length.above(0)
.contexts().should.eventually.have.length.above(0)
.nodeify(done);
});
it('contexts should be strings', function (done) {
@@ -45,7 +45,8 @@ describe('webview - basics', function () {
}).nodeify(done);
});
it('setting context to \'WEBVIEW_1\' should work', function (done) {
driver.contexts().should.eventually.have.length.above(0)
driver
.contexts().should.eventually.have.length.above(0)
.context("WEBVIEW_1")
.sleep(500)
.get(env.GUINEA_TEST_END_POINT)