mirror of
https://github.com/appium/appium.git
synced 2026-02-10 11:59:45 -06:00
Merge pull request #2731 from sebv/dynamic-bootstrap
Dynamic bootstrap + minor changes
This commit is contained in:
@@ -30,7 +30,7 @@ var path = require('path')
|
||||
, mkdirp = require('mkdirp')
|
||||
, getSimRoot = settings.getSimRoot
|
||||
, fruitstrap = path.resolve(__dirname, '../../../build/fruitstrap/fruitstrap')
|
||||
, uiauto = require('appium-uiauto')
|
||||
, prepareBootstrap = require('./uiauto').prepareBootstrap
|
||||
, UnknownError = errors.UnknownError;
|
||||
|
||||
// XML Plist library helper
|
||||
@@ -286,8 +286,11 @@ IOS.prototype.start = function (cb, onDie) {
|
||||
|
||||
IOS.prototype.createInstruments = function (cb) {
|
||||
logger.debug("Creating instruments");
|
||||
this.instruments = this.makeInstruments();
|
||||
cb();
|
||||
this.makeInstruments(function (err, instruments) {
|
||||
if (err) return cb(err);
|
||||
this.instruments = instruments;
|
||||
cb();
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
IOS.prototype.startInstruments = function (cb) {
|
||||
@@ -309,22 +312,27 @@ IOS.prototype.startInstruments = function (cb) {
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
IOS.prototype.makeInstruments = function () {
|
||||
return new Instruments({
|
||||
app: this.args.app || this.args.bundleId
|
||||
, udid: this.args.udid
|
||||
, processArguments: this.args.processArguments
|
||||
, ignoreStartupExit: this.shouldIgnoreInstrumentsExit()
|
||||
, bootstrap: uiauto.bootstrap
|
||||
, template: this.args.automationTraceTemplatePath
|
||||
, sock: sock
|
||||
, withoutDelay: this.args.withoutDelay
|
||||
, xcodeVersion: this.xcodeVersion
|
||||
, webSocket: this.args.webSocket
|
||||
, launchTimeout: this.args.launchTimeout
|
||||
, flakeyRetries: this.args.backendRetries
|
||||
, simulatorSdkAndDevice: this.iOSSDKVersion >= 7.1 ? this.getDeviceString() : null
|
||||
});
|
||||
IOS.prototype.makeInstruments = function (cb) {
|
||||
prepareBootstrap({ verboseInstruments: !this.args.quiet }).then(
|
||||
function (bootstrapPath) {
|
||||
var instruments = new Instruments({
|
||||
app: this.args.app || this.args.bundleId
|
||||
, udid: this.args.udid
|
||||
, processArguments: this.args.processArguments
|
||||
, ignoreStartupExit: this.shouldIgnoreInstrumentsExit()
|
||||
, bootstrap: bootstrapPath
|
||||
, template: this.args.automationTraceTemplatePath
|
||||
, sock: sock
|
||||
, withoutDelay: this.args.withoutDelay
|
||||
, xcodeVersion: this.xcodeVersion
|
||||
, webSocket: this.args.webSocket
|
||||
, launchTimeout: this.args.launchTimeout
|
||||
, flakeyRetries: this.args.backendRetries
|
||||
, simulatorSdkAndDevice: this.iOSSDKVersion >= 7.1 ? this.getDeviceString() : null
|
||||
});
|
||||
cb(null, instruments);
|
||||
}.bind(this), function (err) { cb(err); }
|
||||
);
|
||||
};
|
||||
|
||||
IOS.prototype.shouldIgnoreInstrumentsExit = function () {
|
||||
@@ -578,10 +586,11 @@ IOS.prototype.instantLaunchAndQuit = function (cb) {
|
||||
"to populate the applications and preference dirs");
|
||||
this.setDeviceAndLaunchSimulator(function (err) {
|
||||
if (err) return cb(err);
|
||||
var instrumentsIsDeadLongLiveInstruments = this.makeInstruments();
|
||||
instrumentsIsDeadLongLiveInstruments.launchAndKill(1000, function (err) {
|
||||
if (err) return cb(err);
|
||||
this.endSimulator(cb);
|
||||
this.makeInstruments(function (err, instruments) {
|
||||
instruments.launchAndKill(1000, function (err) {
|
||||
if (err) return cb(err);
|
||||
this.endSimulator(cb);
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
9
lib/devices/ios/uiauto.js
Normal file
9
lib/devices/ios/uiauto.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// Gets instrument from npm package and setup logger
|
||||
"use strict";
|
||||
|
||||
var uiauto = require('appium-uiauto'),
|
||||
logger = uiauto.logger;
|
||||
|
||||
logger.init(require('../../server/logger.js').get('appium'));
|
||||
|
||||
module.exports = uiauto;
|
||||
@@ -226,17 +226,17 @@ module.exports.startListening = function (server, args, parser, appiumVer, appiu
|
||||
if (appiumRev) {
|
||||
welcome += " (REV " + appiumRev + ")";
|
||||
}
|
||||
logger.info(welcome);
|
||||
logger.warn(welcome);
|
||||
var logMessage = "Appium REST http interface listener started on " +
|
||||
args.address + ":" + args.port;
|
||||
logger.info(logMessage);
|
||||
logger.warn(logMessage);
|
||||
startAlertSocket(server, appiumServer);
|
||||
if (args.nodeconfig !== null) {
|
||||
gridRegister.registerNode(args.nodeconfig, args.address, args.port);
|
||||
}
|
||||
var showArgs = getNonDefaultArgs(parser, args);
|
||||
if (_.size(showArgs)) {
|
||||
logger.info("Non-default server args: " + JSON.stringify(showArgs));
|
||||
logger.warn("Non-default server args: " + JSON.stringify(showArgs));
|
||||
}
|
||||
});
|
||||
server.on('error', function (err) {
|
||||
|
||||
@@ -44,6 +44,9 @@ module.exports.init = function (args) {
|
||||
|
||||
if (args.quiet) {
|
||||
logger.transports.console.level = 'warn';
|
||||
} else {
|
||||
//TODO: pass loglevel in server args
|
||||
logger.transports.console.level = process.env.APPIUM_LOGLEVEL || 'info';
|
||||
}
|
||||
|
||||
if (args.log) {
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
"adm-zip": "~0.4.4",
|
||||
"appium-adb": "~1.0.1",
|
||||
"appium-atoms": "~0.0.5",
|
||||
"appium-instruments": "~0.1.21",
|
||||
"appium-uiauto": "~0.0.20",
|
||||
"appium-instruments": "1.0.0-beta1",
|
||||
"appium-uiauto": "1.0.0-beta1",
|
||||
"argparse": "~0.1.15",
|
||||
"async": "~0.9.0",
|
||||
"binary-cookies": "~0.1.1",
|
||||
|
||||
Submodule submodules/appium-instruments updated: 67980fd08f...483a6dcf13
Submodule submodules/appium-uiauto updated: 8f22246b10...f0c7f9c774
Reference in New Issue
Block a user