From 526ad15c01b1cc120b627d63c410e8dde27823e3 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Mon, 5 Jun 2017 13:13:46 +0100 Subject: [PATCH] AndroidResource: Updated APKFile to add support for uiautomator tests. In newer versions of adb, files cannot be installed unless they use the `.apk` extension therefore we need to be able to distinguish between regular apks and instrumented test files. --- wlauto/common/android/resources.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wlauto/common/android/resources.py b/wlauto/common/android/resources.py index 1a7cf641..561eeef0 100644 --- a/wlauto/common/android/resources.py +++ b/wlauto/common/android/resources.py @@ -35,12 +35,14 @@ class ApkFile(FileResource): name = 'apk' - def __init__(self, owner, platform=None): + def __init__(self, owner, platform=None, uiauto=False): super(ApkFile, self).__init__(owner) self.platform = platform + self.uiauto = uiauto def __str__(self): - return '<{}\'s {} APK>'.format(self.owner, self.platform) + apk_type = 'uiautomator ' if self.uiauto else '' + return '<{}\'s {} {}APK>'.format(self.owner, self.platform, apk_type) class uiautoApkFile(FileResource):