mirror of
https://github.com/appium/appium.git
synced 2026-02-09 03:09:02 -06:00
don't fail test if we can't find strings.xml (fix #1905)
also, make sure apidemos tests run as android even if DEVICE isn't set
This commit is contained in:
@@ -294,8 +294,11 @@ Android.prototype.pushStrings = function (cb) {
|
||||
logger.debug(makeStrings);
|
||||
exec(makeStrings, { maxBuffer: 524288 }, function (err, stdout, stderr) {
|
||||
if (err) {
|
||||
// if we can't get strings, just dump an empty json and continue
|
||||
logger.warn("Error getting strings.xml from apk");
|
||||
logger.debug(stderr);
|
||||
return cb(new Error("Could not make strings from apk"));
|
||||
var remoteFile = path.resolve(remotePath, stringsJson);
|
||||
return this.adb.shell("echo '{}' > " + remoteFile, cb);
|
||||
}
|
||||
var jsonFile = path.resolve(outputPath, stringsJson);
|
||||
this.adb.push(jsonFile, remotePath, function (err) {
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
var getAppPath = require('../../../helpers/app').getAppPath;
|
||||
|
||||
module.exports = {
|
||||
app: getAppPath('ApiDemos'),
|
||||
app: getAppPath('ApiDemos', 'android'),
|
||||
device: 'Android',
|
||||
'app-package': 'com.example.android.apis',
|
||||
'app-activity': '.ApiDemos'
|
||||
};
|
||||
|
||||
@@ -3,7 +3,14 @@
|
||||
var env = require('./env'),
|
||||
path = require('path');
|
||||
|
||||
module.exports.getAppPath = function (app) {
|
||||
module.exports.getAppPath = function (app, device) {
|
||||
if (device && device[0] === "i") {
|
||||
env.IOS = true;
|
||||
env.ANDROID = false;
|
||||
} else if (device && device.toLowerCase() === "android") {
|
||||
env.ANDROID = true;
|
||||
env.IOS = false;
|
||||
}
|
||||
if (env.IOS) {
|
||||
return path.resolve(__dirname, "../../sample-code/apps/" + app +
|
||||
"/build/Release-iphonesimulator/" + app + ".app");
|
||||
|
||||
Reference in New Issue
Block a user