mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 12:58:36 +00:00
GooglePlayBooks: Modified ActionLogger tags and capture points
This commit is contained in:
parent
5b7d61b4b9
commit
1dfbaf4ebe
@ -74,6 +74,6 @@ class Googleplaybooks(AndroidUxPerfWorkload):
|
|||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
super(Googleplaybooks, self).validate()
|
super(Googleplaybooks, self).validate()
|
||||||
self.uiauto_params['book_title'] = self.search_book_title.replace(" ", "_")
|
self.uiauto_params['book_title'] = self.search_book_title.replace(" ", "0space0")
|
||||||
self.uiauto_params['chapter_page_number'] = self.select_chapter_page_number
|
self.uiauto_params['chapter_page_number'] = self.select_chapter_page_number
|
||||||
self.uiauto_params['search_word'] = self.search_word
|
self.uiauto_params['search_word'] = self.search_word
|
||||||
|
Binary file not shown.
@ -49,7 +49,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
packageName = parameters.getString("package");
|
packageName = parameters.getString("package");
|
||||||
packageID = packageName + ":id/";
|
packageID = packageName + ":id/";
|
||||||
|
|
||||||
String bookTitle = parameters.getString("book_title").replace("_", " ");
|
String bookTitle = parameters.getString("book_title").replace("0space0", " ");
|
||||||
String chapterPageNumber = parameters.getString("chapter_page_number");
|
String chapterPageNumber = parameters.getString("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";
|
||||||
@ -241,6 +241,8 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void openBook(final String bookTitle) throws Exception {
|
private void openBook(final String bookTitle) throws Exception {
|
||||||
|
String testTag = "open_book";
|
||||||
|
ActionLogger logger = new ActionLogger(testTag, parameters);
|
||||||
|
|
||||||
UiScrollable cardsGrid =
|
UiScrollable cardsGrid =
|
||||||
new UiScrollable(new UiSelector().resourceId(packageID + "cards_grid"));
|
new UiScrollable(new UiSelector().resourceId(packageID + "cards_grid"));
|
||||||
@ -272,12 +274,14 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
"Exceeded maximum wait time (" + maxWaitTimeSeconds + " seconds) to download book \"" + bookTitle + "\"");
|
"Exceeded maximum wait time (" + maxWaitTimeSeconds + " seconds) to download book \"" + bookTitle + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.start();
|
||||||
book.click();
|
book.click();
|
||||||
waitForPage();
|
waitForPage();
|
||||||
|
logger.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gesturesTest() throws Exception {
|
private void gesturesTest() throws Exception {
|
||||||
String testTag = "gestures";
|
String testTag = "gesture";
|
||||||
|
|
||||||
// Perform a range of swipe tests while browsing home photoplaybooks gallery
|
// Perform a range of swipe tests while browsing home photoplaybooks gallery
|
||||||
LinkedHashMap<String, GestureTestParams> testParams = new LinkedHashMap<String, GestureTestParams>();
|
LinkedHashMap<String, GestureTestParams> testParams = new LinkedHashMap<String, GestureTestParams>();
|
||||||
@ -307,9 +311,6 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
case UIDEVICE_SWIPE:
|
case UIDEVICE_SWIPE:
|
||||||
uiDeviceSwipe(dir, steps);
|
uiDeviceSwipe(dir, steps);
|
||||||
break;
|
break;
|
||||||
case UIOBJECT_SWIPE:
|
|
||||||
uiObjectSwipe(pageView, dir, steps);
|
|
||||||
break;
|
|
||||||
case PINCH:
|
case PINCH:
|
||||||
uiObjectVertPinch(pageView, pinch, steps, percent);
|
uiObjectVertPinch(pageView, pinch, steps, percent);
|
||||||
break;
|
break;
|
||||||
@ -365,12 +366,13 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addNote(final String text) throws Exception {
|
private void addNote(final String text) throws Exception {
|
||||||
String testTag = "add_note";
|
String testTag = "note_add";
|
||||||
ActionLogger logger = new ActionLogger(testTag, parameters);
|
ActionLogger logger = new ActionLogger(testTag, parameters);
|
||||||
logger.start();
|
|
||||||
|
|
||||||
hideDropDownMenu();
|
hideDropDownMenu();
|
||||||
|
|
||||||
|
logger.start();
|
||||||
|
|
||||||
UiObject clickable = new UiObject(new UiSelector().longClickable(true));
|
UiObject clickable = new UiObject(new UiSelector().longClickable(true));
|
||||||
uiObjectPerformLongClick(clickable, 100);
|
uiObjectPerformLongClick(clickable, 100);
|
||||||
|
|
||||||
@ -395,7 +397,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeNote() throws Exception {
|
private void removeNote() throws Exception {
|
||||||
String testTag = "remove_note";
|
String testTag = "note_remove";
|
||||||
ActionLogger logger = new ActionLogger(testTag, parameters);
|
ActionLogger logger = new ActionLogger(testTag, parameters);
|
||||||
logger.start();
|
logger.start();
|
||||||
|
|
||||||
@ -415,17 +417,20 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void searchForWord(final String text) throws Exception {
|
private void searchForWord(final String text) throws Exception {
|
||||||
String testTag = "search_for_word";
|
String testTag = "search_word";
|
||||||
ActionLogger logger = new ActionLogger(testTag, parameters);
|
ActionLogger logger = new ActionLogger(testTag, parameters);
|
||||||
|
|
||||||
getDropdownMenu();
|
getDropdownMenu();
|
||||||
logger.start();
|
|
||||||
UiObject search = new UiObject(
|
UiObject search = new UiObject(
|
||||||
new UiSelector().resourceId(packageID + "menu_search"));
|
new UiSelector().resourceId(packageID + "menu_search"));
|
||||||
search.click();
|
search.click();
|
||||||
|
|
||||||
UiObject searchText = new UiObject(
|
UiObject searchText = new UiObject(
|
||||||
new UiSelector().resourceId(packageID + "search_src_text"));
|
new UiSelector().resourceId(packageID + "search_src_text"));
|
||||||
|
|
||||||
|
logger.start();
|
||||||
|
|
||||||
searchText.setText(text);
|
searchText.setText(text);
|
||||||
pressEnter();
|
pressEnter();
|
||||||
|
|
||||||
@ -448,11 +453,12 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.stop();
|
logger.stop();
|
||||||
|
|
||||||
pressBack();
|
pressBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchPageStyles() throws Exception {
|
private void switchPageStyles() throws Exception {
|
||||||
String testTag = "switch_page_style";
|
String testTag = "style";
|
||||||
|
|
||||||
getDropdownMenu();
|
getDropdownMenu();
|
||||||
UiObject readerSettings = getUiObjectByResourceId(packageID + "menu_reader_settings",
|
UiObject readerSettings = getUiObjectByResourceId(packageID + "menu_reader_settings",
|
||||||
@ -472,8 +478,8 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
for (String style : styles) {
|
for (String style : styles) {
|
||||||
try {
|
try {
|
||||||
ActionLogger logger = new ActionLogger(testTag + "_" + style, parameters);
|
ActionLogger logger = new ActionLogger(testTag + "_" + style, parameters);
|
||||||
logger.start();
|
|
||||||
UiObject pageStyle = new UiObject(new UiSelector().description(style));
|
UiObject pageStyle = new UiObject(new UiSelector().description(style));
|
||||||
|
logger.start();
|
||||||
pageStyle.clickAndWaitForNewWindow(viewTimeout);
|
pageStyle.clickAndWaitForNewWindow(viewTimeout);
|
||||||
logger.stop();
|
logger.stop();
|
||||||
} catch (UiObjectNotFoundException e) {
|
} catch (UiObjectNotFoundException e) {
|
||||||
@ -490,21 +496,24 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void aboutBook() throws Exception {
|
private void aboutBook() throws Exception {
|
||||||
String testTag = "about_book";
|
String testTag = "open_about";
|
||||||
ActionLogger logger = new ActionLogger(testTag, parameters);
|
ActionLogger logger = new ActionLogger(testTag, parameters);
|
||||||
|
|
||||||
getDropdownMenu();
|
getDropdownMenu();
|
||||||
logger.start();
|
|
||||||
|
|
||||||
UiObject moreOptions = getUiObjectByDescription("More options", "android.widget.ImageView");
|
UiObject moreOptions = getUiObjectByDescription("More options", "android.widget.ImageView");
|
||||||
moreOptions.click();
|
moreOptions.click();
|
||||||
|
|
||||||
UiObject bookInfo = getUiObjectByText("About this book", "android.widget.TextView");
|
UiObject bookInfo = getUiObjectByText("About this book", "android.widget.TextView");
|
||||||
|
|
||||||
|
logger.start();
|
||||||
|
|
||||||
bookInfo.clickAndWaitForNewWindow(uiAutoTimeout);
|
bookInfo.clickAndWaitForNewWindow(uiAutoTimeout);
|
||||||
|
|
||||||
UiObject detailsPanel =
|
UiObject detailsPanel =
|
||||||
new UiObject(new UiSelector().resourceId("com.android.vending:id/item_details_panel"));
|
new UiObject(new UiSelector().resourceId("com.android.vending:id/item_details_panel"));
|
||||||
waitObject(detailsPanel, viewTimeoutSecs);
|
waitObject(detailsPanel, viewTimeoutSecs);
|
||||||
|
|
||||||
logger.stop();
|
logger.stop();
|
||||||
|
|
||||||
pressBack();
|
pressBack();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user