mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 12:06:08 +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:
parent
d1e960e9b0
commit
61bb162350
@ -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 = [
|
||||||
|
Binary file not shown.
@ -124,7 +124,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
|
|||||||
throw new UiObjectNotFoundException("No email account setup on device. Set up at least one email address");
|
throw new UiObjectNotFoundException("No email account setup on device. Set up at least one email address");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dismiss fresh new look pop up messages
|
// Dismiss fresh new look pop up messages
|
||||||
UiObject newLookMessageDismissButton =
|
UiObject newLookMessageDismissButton =
|
||||||
mDevice.findObject(new UiSelector().resourceId(packageID + "gm_dismiss_button")
|
mDevice.findObject(new UiSelector().resourceId(packageID + "gm_dismiss_button")
|
||||||
@ -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")
|
||||||
@ -186,10 +195,10 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
|
|||||||
// Return to conversation/home screen
|
// Return to conversation/home screen
|
||||||
mDevice.pressBack();
|
mDevice.pressBack();
|
||||||
if(!conversationView.exists()) {
|
if(!conversationView.exists()) {
|
||||||
mDevice.pressBack();
|
mDevice.pressBack();
|
||||||
}
|
}
|
||||||
if(!conversationView.exists()) {
|
if(!conversationView.exists()) {
|
||||||
mDevice.pressBack();
|
mDevice.pressBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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,10 +247,11 @@ 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
|
||||||
UiObject menuListButton = mDevice.findObject(new UiSelector().resourceId("com.android.documentsui:id/menu_list")
|
UiObject menuListButton = mDevice.findObject(new UiSelector().resourceId("com.android.documentsui:id/menu_list")
|
||||||
.className("android.widget.TextView"));
|
.className("android.widget.TextView"));
|
||||||
if (menuListButton.exists()) {
|
if (menuListButton.exists()) {
|
||||||
menuListButton.click();
|
menuListButton.click();
|
||||||
@ -258,7 +266,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
|
|||||||
UiObject photos =
|
UiObject photos =
|
||||||
mDevice.findObject(new UiSelector().text("Photos")
|
mDevice.findObject(new UiSelector().text("Photos")
|
||||||
.className("android.widget.TextView"));
|
.className("android.widget.TextView"));
|
||||||
|
|
||||||
photos.click();
|
photos.click();
|
||||||
|
|
||||||
UiObject working_directory =
|
UiObject working_directory =
|
||||||
@ -267,21 +275,21 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
|
|||||||
|
|
||||||
working_directory.waitForExists (uiAutoTimeout);
|
working_directory.waitForExists (uiAutoTimeout);
|
||||||
working_directory.click();
|
working_directory.click();
|
||||||
|
|
||||||
//Click test image
|
//Click test image
|
||||||
UiObject imageFileButton =
|
UiObject imageFileButton =
|
||||||
mDevice.findObject(new UiSelector().descriptionContains("Photo"));
|
mDevice.findObject(new UiSelector().descriptionContains("Photo"));
|
||||||
|
|
||||||
imageFileButton.click();
|
imageFileButton.click();
|
||||||
|
|
||||||
UiObject accept = getUiObjectByText("DONE");
|
UiObject accept = getUiObjectByText("DONE");
|
||||||
|
|
||||||
if (accept.waitForExists (uiAutoTimeout)) {
|
if (accept.waitForExists (uiAutoTimeout)) {
|
||||||
accept.click();
|
accept.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.stop();
|
logger.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user