diff --git a/wlauto/workloads/googleslides/__init__.py b/wlauto/workloads/googleslides/__init__.py index 1791fe8d..e64de16a 100755 --- a/wlauto/workloads/googleslides/__init__.py +++ b/wlauto/workloads/googleslides/__init__.py @@ -23,6 +23,7 @@ class GoogleSlides(AndroidUxPerfWorkload): name = 'googleslides' package = 'com.google.android.apps.docs.editors.slides' + activity = '' view = [package + '/com.google.android.apps.docs.quickoffice.filepicker.FilePickerActivity', package + '/com.google.android.apps.docs.editors.shared.filepicker.FilePickerActivity', @@ -78,7 +79,7 @@ class GoogleSlides(AndroidUxPerfWorkload): It MAY NOT ALWAYS WORK on your device. If you do run into problems, it might help to set ``do_text_entry`` parameter to ``False``. - Known working APK version: 1.6.312.08 + Known working APK version: 1.7.032.06 ''' parameters = [ diff --git a/wlauto/workloads/googleslides/com.arm.wlauto.uiauto.googleslides.jar b/wlauto/workloads/googleslides/com.arm.wlauto.uiauto.googleslides.jar index 0d8af41b..a40d6060 100644 Binary files a/wlauto/workloads/googleslides/com.arm.wlauto.uiauto.googleslides.jar and b/wlauto/workloads/googleslides/com.arm.wlauto.uiauto.googleslides.jar differ diff --git a/wlauto/workloads/googleslides/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java b/wlauto/workloads/googleslides/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java index a1fa8c44..44eacbad 100755 --- a/wlauto/workloads/googleslides/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java +++ b/wlauto/workloads/googleslides/uiauto/src/com/arm/wlauto/uiauto/UiAutomation.java @@ -62,6 +62,8 @@ public class UiAutomation extends UxPerfUiAutomation { // UI automation begins here skipWelcomeScreen(); sleep(1); + dismissUpdateDialog(); + sleep(1); dismissWorkOfflineBanner(); sleep(1); enablePowerpointCompat(); @@ -84,6 +86,14 @@ public class UiAutomation extends UxPerfUiAutomation { } } + public void dismissUpdateDialog() throws Exception { + UiObject update = + new UiObject(new UiSelector().textContains("App update recommended")); + if (update.waitForExists(WAIT_TIMEOUT_1SEC)) { + clickUiObject(BY_TEXT, "Dismiss"); + } + } + public void enterTextInSlide(String viewName, String textToEnter) throws Exception { UiObject view = new UiObject(new UiSelector().resourceId(packageID + "main_canvas") @@ -198,11 +208,11 @@ public class UiAutomation extends UxPerfUiAutomation { public void newDocument() throws Exception { String testTag = "document_new"; ActionLogger logger = new ActionLogger(testTag, parameters); - logger.start(); clickUiObject(BY_DESC, "New presentation"); clickUiObject(BY_TEXT, "New PowerPoint", true); - logger.stop(); + logger.stop(); + dismissUpdateDialog(); } public void saveDocument(String docName) throws Exception { @@ -210,9 +220,9 @@ public class UiAutomation extends UxPerfUiAutomation { ActionLogger logger = new ActionLogger(testTag, parameters); UiObject saveActionButton = - new UiObject(new UiSelector().resourceId(packageID + "action")); + new UiObject(new UiSelector().text("save")); UiObject unsavedIndicator = - new UiObject(new UiSelector().textContains("Not saved")); + new UiObject(new UiSelector().textContains("Unsaved changes")); logger.start(); if (saveActionButton.waitForExists(WAIT_TIMEOUT_1SEC)) { saveActionButton.click(); @@ -293,7 +303,6 @@ public class UiAutomation extends UxPerfUiAutomation { protected void enablePowerpointCompat() throws Exception { String testTag = "enable_pptmode"; ActionLogger logger = new ActionLogger(testTag, parameters); - logger.start(); clickUiObject(BY_DESC, "drawer"); clickUiObject(BY_TEXT, "Settings", true); @@ -310,6 +319,7 @@ public class UiAutomation extends UxPerfUiAutomation { // Slide 1 - Text if (doTextEntry) { enterTextInSlide(".*[Tt]itle.*", docName); + windowApplication(); // Save saveDocument(docName); sleep(1); @@ -442,4 +452,12 @@ public class UiAutomation extends UxPerfUiAutomation { // 10px from top of view, 10px from the right edge tapDisplay(bounds.right - 10, bounds.top + 10); } + + public void windowApplication() throws Exception { + UiObject window = + new UiObject(new UiSelector().resourceId("android:id/restore_window")); + if (window.waitForExists(WAIT_TIMEOUT_1SEC)){ + window.click(); + } + } }