diff --git a/wlauto/common/android/BaseUiAutomation.class b/wlauto/common/android/BaseUiAutomation.class index c0dd0a17..674fd94c 100644 Binary files a/wlauto/common/android/BaseUiAutomation.class and b/wlauto/common/android/BaseUiAutomation.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class b/wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class index a62db9e1..e0ab657d 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class and b/wlauto/common/android/UxPerfUiAutomation$GestureTestParams.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation$GestureType.class b/wlauto/common/android/UxPerfUiAutomation$GestureType.class index fc2cf4d2..47ddd88d 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation$GestureType.class and b/wlauto/common/android/UxPerfUiAutomation$GestureType.class differ diff --git a/wlauto/common/android/UxPerfUiAutomation.class b/wlauto/common/android/UxPerfUiAutomation.class index 016b784f..0e6fc94e 100644 Binary files a/wlauto/common/android/UxPerfUiAutomation.class and b/wlauto/common/android/UxPerfUiAutomation.class differ diff --git a/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UxPerfUiAutomation.java b/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UxPerfUiAutomation.java index 68ec38fc..88d65c6f 100644 --- a/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UxPerfUiAutomation.java +++ b/wlauto/external/uiauto/src/com/arm/wlauto/uiauto/UxPerfUiAutomation.java @@ -30,6 +30,16 @@ public class UxPerfUiAutomation extends BaseUiAutomation { packageID = packageName + ":id/"; } + public void setWorkloadParameters(Bundle parameters, String packageName, String packageID){ + this.parameters = parameters; + this.packageName = packageName; + this.packageID = packageID; + } + + public String getPackageID(){ + return packageID; + } + private Logger logger = Logger.getLogger(UxPerfUiAutomation.class.getName()); public enum GestureType { UIDEVICE_SWIPE, UIOBJECT_SWIPE, PINCH }; diff --git a/wlauto/workloads/appshare/__init__.py b/wlauto/workloads/appshare/__init__.py index 8ce87a5f..80b063cf 100755 --- a/wlauto/workloads/appshare/__init__.py +++ b/wlauto/workloads/appshare/__init__.py @@ -141,7 +141,7 @@ class AppShare(AndroidUxPerfWorkload): self.uiauto_params['recipient'] = self.email_recipient self.uiauto_params['my_id'] = self.skype_login_name self.uiauto_params['my_pwd'] = self.skype_login_pass - self.uiauto_params['name'] = self.skype_contact_name.replace(' ', '0space0') + self.uiauto_params['name'] = self.skype_contact_name # Only accept certain image formats if os.path.splitext(self.test_image.lower())[1] not in ['.jpg', '.jpeg', '.png']: raise ValidationError('{} must be a JPEG or PNG file'.format(self.test_image)) diff --git a/wlauto/workloads/appshare/com.arm.wlauto.uiauto.appshare.jar b/wlauto/workloads/appshare/com.arm.wlauto.uiauto.appshare.jar index 6b041d92..64a211e7 100644 Binary files a/wlauto/workloads/appshare/com.arm.wlauto.uiauto.appshare.jar and b/wlauto/workloads/appshare/com.arm.wlauto.uiauto.appshare.jar differ diff --git a/wlauto/workloads/appshare/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/appshare/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index 5afbba8a..f5c5f298 100755 --- a/wlauto/workloads/appshare/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/appshare/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -39,20 +39,18 @@ public class UiAutomation extends UxPerfUiAutomation { // should not log actions themselves. Bundle dummyParams = new Bundle(); dummyParams.putString("markers_enabled", "false"); - googlephotos.parameters = dummyParams; - googlephotos.packageName = parameters.getString("googlephotos_package"); - googlephotos.packageID = googlephotos.packageName + ":id/"; - gmail.parameters = dummyParams; - gmail.packageName = parameters.getString("gmail_package"); - gmail.packageID = gmail.packageName + ":id/"; - skype.parameters = dummyParams; - skype.packageName = parameters.getString("skype_package"); - skype.packageID = skype.packageName + ":id/"; + + String packageName = parameters.getString("googlephotos_package"); + googlephotos.setWorkloadParameters(dummyParams, packageName, packageName + ":id/"); + packageName = parameters.getString("gmail_package"); + gmail.setWorkloadParameters(dummyParams, packageName, packageName + ":id/"); + packageName = parameters.getString("skype_package"); + skype.setWorkloadParameters(dummyParams, packageName, packageName + ":id/"); String recipient = parameters.getString("recipient"); String loginName = parameters.getString("my_id"); String loginPass = parameters.getString("my_pwd"); - String contactName = parameters.getString("name").replace("0space0", " "); + String contactName = parameters.getString("name"); setScreenOrientation(ScreenOrientation.NATURAL); @@ -61,7 +59,15 @@ public class UiAutomation extends UxPerfUiAutomation { logIntoSkype(loginName, loginPass); // Skype won't allow us to login and share on first visit so invoke // once more from googlephotos - pressBack(); + pressBack(); + + // On some devices the first back press only hides the keyboard, check if + // another is needed. + UiObject googlephotosShare = new UiObject(new UiSelector().packageName( + parameters.getString("googlephotos_package"))); + if (!googlephotosShare.exists()){ + pressBack(); + } sendToSkype(contactName); unsetScreenOrientation(); @@ -75,7 +81,7 @@ public class UiAutomation extends UxPerfUiAutomation { } private void sendToGmail(String recipient) throws Exception { - String gID = gmail.packageID; + String gID = gmail.getPackageID(); shareUsingApp("Gmail", "gmail"); @@ -121,11 +127,15 @@ public class UiAutomation extends UxPerfUiAutomation { clickUiObject(BY_DESC, "Share", "android.widget.ImageView"); UiScrollable applicationGrid = - new UiScrollable(new UiSelector().resourceId(googlephotos.packageID + "application_grid")); + new UiScrollable(new UiSelector().resourceId(googlephotos.getPackageID() + "application_grid")); + if (!applicationGrid.exists()){ + applicationGrid = + new UiScrollable(new UiSelector().resourceId(googlephotos.getPackageID() + "share_expander")); + } UiObject openApp = new UiObject(new UiSelector().text(appName) .className("android.widget.TextView")); - // On some devices the application_grid has many entries, se we have to swipe up to make + // On some devices the application_grid has many entries, so we have to swipe up to make // sure all the entries are visable. This will also stop entries at the bottom being // obscured by the bottom action bar. applicationGrid.swipeUp(10);