1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

workloads/gmail: Update workload to latest apk version

The Google services required in the old apk appear to no
longer be avaliable. Update to support a newer version.
This commit is contained in:
Marc Bonnici 2023-04-29 22:39:02 +01:00
parent d1e960e9b0
commit 61bb162350
3 changed files with 35 additions and 19 deletions

View File

@ -44,7 +44,7 @@ class Gmail(ApkUiautoWorkload):
The result should then be placed in the '~/.workload_automation/dependencies/gmail/' directory The result should then be placed in the '~/.workload_automation/dependencies/gmail/' directory
on your local machine, creating this if it does not already exist. on your local machine, creating this if it does not already exist.
Known working APK version: 2019.05.26.252424914.release Known working APK version: 2023.04.02.523594694.Release
''' '''
parameters = [ parameters = [

View File

@ -137,6 +137,15 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
newLookMessageDismissButton.click(); newLookMessageDismissButton.click();
} }
// Dismiss google meet integration popup
UiObject googleMeetDismissPopUp =
mDevice.findObject(new UiSelector().resourceId(packageID + "next_button")
.className("android.widget.Button"));
if (googleMeetDismissPopUp.exists()) {
googleMeetDismissPopUp.click();
}
// If we're in offline mode we don't need to worry about syncing, so we're done // If we're in offline mode we don't need to worry about syncing, so we're done
if (offlineMode) { if (offlineMode) {
return; return;
@ -174,7 +183,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
//Get rid of smart compose message on newer versions and return to home screen before ckickNewMail test //Get rid of smart compose message on newer versions and return to home screen before ckickNewMail test
UiObject newMailButton = UiObject newMailButton =
getUiObjectByDescription("Compose", "android.widget.ImageButton"); getUiObjectByDescription("Compose");
newMailButton.click(); newMailButton.click();
UiObject smartComposeDismissButton = mDevice.findObject(new UiSelector().textContains("Got it") UiObject smartComposeDismissButton = mDevice.findObject(new UiSelector().textContains("Got it")
@ -198,7 +207,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
ActionLogger logger = new ActionLogger(testTag, parameters); ActionLogger logger = new ActionLogger(testTag, parameters);
UiObject newMailButton = UiObject newMailButton =
getUiObjectByDescription("Compose", "android.widget.ImageButton"); getUiObjectByDescription("Compose");
logger.start(); logger.start();
newMailButton.clickAndWaitForNewWindow(uiAutoTimeout); newMailButton.clickAndWaitForNewWindow(uiAutoTimeout);
@ -210,8 +219,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
ActionLogger logger = new ActionLogger(testTag, parameters); ActionLogger logger = new ActionLogger(testTag, parameters);
UiObject attachIcon = UiObject attachIcon =
mDevice.findObject(new UiSelector().resourceId(packageID + "add_attachment") mDevice.findObject(new UiSelector().resourceId(packageID + "add_attachment"));
.className("android.widget.TextView"));
logger.start(); logger.start();
@ -228,8 +236,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
// Show Roots menu // Show Roots menu
UiObject rootMenu = UiObject rootMenu =
mDevice.findObject(new UiSelector().descriptionContains("Show root") mDevice.findObject(new UiSelector().descriptionContains("Show root"));
.className("android.widget.ImageButton"));
if (rootMenu.exists()){ if (rootMenu.exists()){
rootMenu.click(); rootMenu.click();
} }
@ -240,6 +247,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
if (imagesEntry.waitForExists(uiAutoTimeout)) { if (imagesEntry.waitForExists(uiAutoTimeout)) {
imagesEntry.click(); imagesEntry.click();
selectGalleryFolder(workdir_name);
selectGalleryFolder(workdir_name); selectGalleryFolder(workdir_name);
//Switch from grid view to menu view to display filename on larger screens //Switch from grid view to menu view to display filename on larger screens
@ -289,7 +297,11 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
String testTag = "text_to"; String testTag = "text_to";
ActionLogger logger = new ActionLogger(testTag, parameters); ActionLogger logger = new ActionLogger(testTag, parameters);
UiObject toField = getUiObjectByResourceId(packageID + "to"); UiObject toField = mDevice.findObject(new UiSelector().resourceId(packageID + "to"));
if (!toField.waitForExists(uiAutoTimeout)) {
toField = mDevice.findObject(new UiSelector().className("android.widget.EditText"));
}
logger.start(); logger.start();
toField.setText(recipient); toField.setText(recipient);
mDevice.pressEnter(); mDevice.pressEnter();
@ -317,6 +329,10 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
if (!composeField.exists()){ if (!composeField.exists()){
composeField = mDevice.findObject(new UiSelector().descriptionContains("Compose email")); composeField = mDevice.findObject(new UiSelector().descriptionContains("Compose email"));
} }
if (!composeField.exists()){
composeField = mDevice.findObject(new UiSelector().resourceId(packageID + "wc_body_layout" ))
.getChild(new UiSelector().className("android.widget.EditText"));
}
logger.start(); logger.start();
composeField.legacySetText("This is a test composition"); composeField.legacySetText("This is a test composition");
@ -328,7 +344,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
String testTag = "click_send"; String testTag = "click_send";
ActionLogger logger = new ActionLogger(testTag, parameters); ActionLogger logger = new ActionLogger(testTag, parameters);
UiObject sendButton = getUiObjectByDescription("Send", "android.widget.TextView"); UiObject sendButton = getUiObjectByDescription("Send");
logger.start(); logger.start();
sendButton.clickAndWaitForNewWindow(uiAutoTimeout); sendButton.clickAndWaitForNewWindow(uiAutoTimeout);
logger.stop(); logger.stop();