1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

Added functions to work with the latest supported APK, to handle the pop up message looking to prompt the user to update and to handle the issue where the save/insert new slide button is not seen when running in maximum window on certain devices.

This commit is contained in:
Scott Jackson 2017-02-17 14:27:26 +00:00
parent 40db6a9933
commit 6f67f00834
3 changed files with 25 additions and 6 deletions

View File

@ -23,6 +23,7 @@ class GoogleSlides(AndroidUxPerfWorkload):
name = 'googleslides' name = 'googleslides'
package = 'com.google.android.apps.docs.editors.slides' package = 'com.google.android.apps.docs.editors.slides'
activity = '' activity = ''
view = [package + '/com.google.android.apps.docs.quickoffice.filepicker.FilePickerActivity', view = [package + '/com.google.android.apps.docs.quickoffice.filepicker.FilePickerActivity',
package + '/com.google.android.apps.docs.editors.shared.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 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``. set ``do_text_entry`` parameter to ``False``.
Known working APK version: 1.6.312.08 Known working APK version: 1.7.032.06
''' '''
parameters = [ parameters = [

View File

@ -62,6 +62,8 @@ public class UiAutomation extends UxPerfUiAutomation {
// UI automation begins here // UI automation begins here
skipWelcomeScreen(); skipWelcomeScreen();
sleep(1); sleep(1);
dismissUpdateDialog();
sleep(1);
dismissWorkOfflineBanner(); dismissWorkOfflineBanner();
sleep(1); sleep(1);
enablePowerpointCompat(); 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 { public void enterTextInSlide(String viewName, String textToEnter) throws Exception {
UiObject view = UiObject view =
new UiObject(new UiSelector().resourceId(packageID + "main_canvas") new UiObject(new UiSelector().resourceId(packageID + "main_canvas")
@ -198,11 +208,11 @@ public class UiAutomation extends UxPerfUiAutomation {
public void newDocument() throws Exception { public void newDocument() throws Exception {
String testTag = "document_new"; String testTag = "document_new";
ActionLogger logger = new ActionLogger(testTag, parameters); ActionLogger logger = new ActionLogger(testTag, parameters);
logger.start(); logger.start();
clickUiObject(BY_DESC, "New presentation"); clickUiObject(BY_DESC, "New presentation");
clickUiObject(BY_TEXT, "New PowerPoint", true); clickUiObject(BY_TEXT, "New PowerPoint", true);
logger.stop(); logger.stop();
dismissUpdateDialog();
} }
public void saveDocument(String docName) throws Exception { public void saveDocument(String docName) throws Exception {
@ -210,9 +220,9 @@ public class UiAutomation extends UxPerfUiAutomation {
ActionLogger logger = new ActionLogger(testTag, parameters); ActionLogger logger = new ActionLogger(testTag, parameters);
UiObject saveActionButton = UiObject saveActionButton =
new UiObject(new UiSelector().resourceId(packageID + "action")); new UiObject(new UiSelector().text("save"));
UiObject unsavedIndicator = UiObject unsavedIndicator =
new UiObject(new UiSelector().textContains("Not saved")); new UiObject(new UiSelector().textContains("Unsaved changes"));
logger.start(); logger.start();
if (saveActionButton.waitForExists(WAIT_TIMEOUT_1SEC)) { if (saveActionButton.waitForExists(WAIT_TIMEOUT_1SEC)) {
saveActionButton.click(); saveActionButton.click();
@ -293,7 +303,6 @@ public class UiAutomation extends UxPerfUiAutomation {
protected void enablePowerpointCompat() throws Exception { protected void enablePowerpointCompat() throws Exception {
String testTag = "enable_pptmode"; String testTag = "enable_pptmode";
ActionLogger logger = new ActionLogger(testTag, parameters); ActionLogger logger = new ActionLogger(testTag, parameters);
logger.start(); logger.start();
clickUiObject(BY_DESC, "drawer"); clickUiObject(BY_DESC, "drawer");
clickUiObject(BY_TEXT, "Settings", true); clickUiObject(BY_TEXT, "Settings", true);
@ -310,6 +319,7 @@ public class UiAutomation extends UxPerfUiAutomation {
// Slide 1 - Text // Slide 1 - Text
if (doTextEntry) { if (doTextEntry) {
enterTextInSlide(".*[Tt]itle.*", docName); enterTextInSlide(".*[Tt]itle.*", docName);
windowApplication();
// Save // Save
saveDocument(docName); saveDocument(docName);
sleep(1); sleep(1);
@ -442,4 +452,12 @@ public class UiAutomation extends UxPerfUiAutomation {
// 10px from top of view, 10px from the right edge // 10px from top of view, 10px from the right edge
tapDisplay(bounds.right - 10, bounds.top + 10); 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();
}
}
} }