1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-22 12:58:36 +00:00

GooglePlayBooks: Updated workload to work with the latest version

GooglePlayBooks UI has changed significantly in the latest
version. This includes extra dialog boxes upon first use
which need to be handled.
This commit is contained in:
scott 2017-08-03 09:47:36 +01:00
parent 220e0962e1
commit d662498ea8
3 changed files with 13 additions and 7 deletions

View File

@ -52,7 +52,7 @@ class Googleplaybooks(AndroidUxPerfWorkload):
Tip: Install the 'Google Opinion Rewards' app to bypass the need to enter valid Tip: Install the 'Google Opinion Rewards' app to bypass the need to enter valid
card/bank detail. card/bank detail.
Known working APK version: 3.9.37 Known working APK version: 3.13.17
''' '''
parameters = [ parameters = [

View File

@ -200,7 +200,7 @@ public void runUiAutomation() throws Exception {
mDevice.findObject(new UiSelector().resourceId(packageID + "menu_search")); mDevice.findObject(new UiSelector().resourceId(packageID + "menu_search"));
if (!search.exists()) { if (!search.exists()) {
search = search =
mDevice.findObject(new UiSelector().resourceId(packageID + "search_box_active_text_view")); mDevice.findObject(new UiSelector().resourceId(packageID + "search_box_idle_text"));
} }
search.click(); search.click();
@ -278,15 +278,21 @@ public void runUiAutomation() throws Exception {
ActionLogger logger = new ActionLogger(testTag, parameters); ActionLogger logger = new ActionLogger(testTag, parameters);
logger.start(); logger.start();
clickUiObject(BY_DESC, "Show navigation drawer"); //clickUiObject(BY_DESC, "Show navigation drawer");
// To correctly find the UiObject we need to specify the index also here // To correctly find the UiObject we need to specify the index also here
UiObject myLibrary = UiObject myLibrary =
mDevice.findObject(new UiSelector().className("android.widget.TextView") mDevice.findObject(new UiSelector().className("android.widget.TextView")
.textMatches(".*[lL]ibrary") .textMatches(".*[lL]ibrary")
.index(3)); .index(3));
myLibrary.clickAndWaitForNewWindow(uiAutoTimeout); if (myLibrary.exists()) {
logger.stop(); myLibrary.clickAndWaitForNewWindow(uiAutoTimeout);
} } else if (!myLibrary.exists()) {
UiObject library =
getUiObjectByResourceId("com.google.android.apps.books:id/jump_text");
library.click();
}
logger.stop();
}
private void openBook(final String bookTitle) throws Exception { private void openBook(final String bookTitle) throws Exception {
String testTag = "open_book"; String testTag = "open_book";