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

Googleplaybooks: Updating workload to work with change in parameter t…

…ypes

Due to a change in the parameter kind we have to update the googleplaybooks workload to work with integers for page numbers as opposed to strings.

This was missed in the previous update: 8f12066
This commit is contained in:
scott 2017-03-09 16:50:26 +00:00
parent 2822949517
commit 773bf26ff2
2 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ public class UiAutomation extends UxPerfUiAutomation implements ApplaunchInterfa
String searchBookTitle = parameters.getString("search_book_title"); String searchBookTitle = parameters.getString("search_book_title");
String libraryBookTitle = parameters.getString("library_book_title"); String libraryBookTitle = parameters.getString("library_book_title");
String chapterPageNumber = parameters.getString("chapter_page_number"); int chapterPageNumber = parameters.getInt("chapter_page_number");
String searchWord = parameters.getString("search_word"); String searchWord = parameters.getString("search_word");
String noteText = "This is a test note"; String noteText = "This is a test note";
@ -341,7 +341,7 @@ public class UiAutomation extends UxPerfUiAutomation implements ApplaunchInterfa
return pageSyncPopUpWatcher; return pageSyncPopUpWatcher;
} }
private void selectChapter(final String chapterPageNumber) throws Exception { private void selectChapter(final int chapterPageNumber) throws Exception {
getDropdownMenu(); getDropdownMenu();
UiObject contents = getUiObjectByResourceId(packageID + "menu_reader_toc"); UiObject contents = getUiObjectByResourceId(packageID + "menu_reader_toc");
@ -349,7 +349,7 @@ public class UiAutomation extends UxPerfUiAutomation implements ApplaunchInterfa
UiObject toChapterView = getUiObjectByResourceId(packageID + "toc_list_view", UiObject toChapterView = getUiObjectByResourceId(packageID + "toc_list_view",
"android.widget.ExpandableListView"); "android.widget.ExpandableListView");
// Navigate to top of chapter view // Navigate to top of chapter view
searchPage(toChapterView, "1", Direction.UP, 10); searchPage(toChapterView, 1, Direction.UP, 10);
// Search for chapter page number // Search for chapter page number
UiObject page = searchPage(toChapterView, chapterPageNumber, Direction.DOWN, 10); UiObject page = searchPage(toChapterView, chapterPageNumber, Direction.DOWN, 10);
// Go to the page // Go to the page
@ -621,14 +621,14 @@ public class UiAutomation extends UxPerfUiAutomation implements ApplaunchInterfa
} }
} }
private UiObject searchPage(final UiObject view, final String pagenum, final Direction updown, private UiObject searchPage(final UiObject view, final int pagenum, final Direction updown,
final int attempts) throws Exception { final int attempts) throws Exception {
if (attempts <= 0) { if (attempts <= 0) {
throw new UiObjectNotFoundException("Could not find \"page number\" after several attempts."); throw new UiObjectNotFoundException("Could not find \"page number\" after several attempts.");
} }
UiObject page = UiObject page =
new UiObject(new UiSelector().description(String.format("page " + pagenum)) new UiObject(new UiSelector().description(String.format("page " + Integer.toString(pagenum)))
.className("android.widget.TextView")); .className("android.widget.TextView"));
if (!page.exists()) { if (!page.exists()) {
// Scroll up by swiping down // Scroll up by swiping down