1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-03-14 14:48:53 +00:00

Merge pull request #8 from jimboatarm/develop

Fixes for Reader/Gmail/Skype
This commit is contained in:
jimboatarm 2016-05-09 15:03:30 +01:00
commit 163e358bf3
6 changed files with 17 additions and 9 deletions

View File

@ -37,12 +37,17 @@ public class UiAutomation extends UxPerfUiAutomation {
}
public void clearFirstRunDialogues () throws Exception {
// Enter search text into the file searchBox. This will automatically filter the list.
UiObject gotItBox = getUiObjectByResourceId("com.google.android.gm:id/welcome_tour_got_it",
"android.widget.TextView");
clickUiObject(gotItBox, timeout);
UiObject takeMeToBox = getUiObjectByText("Take me to Gmail", "android.widget.TextView");
clickUiObject(takeMeToBox, timeout);
// The first run dialogues vary on different devices so check if they are there and dismiss
UiObject gotItBox = new UiObject(new UiSelector().resourceId("com.google.android.gm:id/welcome_tour_got_it")
.className("android.widget.TextView"));
if (gotItBox.exists()) {
clickUiObject(gotItBox, timeout);
}
UiObject takeMeToBox = new UiObject(new UiSelector().textContains("Take me to Gmail")
.className("android.widget.TextView"));
if (takeMeToBox.exists()) {
clickUiObject(takeMeToBox, timeout);
}
UiObject converationView = new UiObject(new UiSelector()
.resourceId("com.google.android.gm:id/conversation_list_view")
.className("android.widget.ListView"));

View File

@ -139,6 +139,8 @@ public class UiAutomation extends UxPerfUiAutomation {
String file = filename.replaceAll("\\.", "_").replaceAll("\\s+", "_");
timingResults.put(String.format(TestTag + "_" + "selectLocalFilesList" + "_" + file), selectLocalFilesList());
// On some devices permissions to access local files occurs here rather than the earlier step
confirmLocalFileAccess();
timingResults.put(String.format(TestTag + "_" + "selectSearchDuration" + "_" + file), selectSearchFileButton());
timingResults.put(String.format(TestTag + "_" + "searchFileList" + "_" + file), searchFileList(filename));
timingResults.put(String.format(TestTag + "_" + "openFileFromList" + "_" + file), openFileFromList(filename));

View File

@ -49,7 +49,7 @@ public class UiAutomation extends UxPerfUiAutomation {
// Run tests
handleLoginScreen(loginName, loginPass);
confirmLocalFileAccess();
confirmAccess();
selectContact(contactName, contactSkypeId);
if ("video".equalsIgnoreCase(callType)) {
videoCallTest(callDuration);
@ -77,11 +77,12 @@ public class UiAutomation extends UxPerfUiAutomation {
signinButton.clickAndWaitForNewWindow();
}
private void confirmLocalFileAccess() throws Exception {
private void confirmAccess() throws Exception {
// First time run requires confirmation to allow access to local files
UiObject allowButton = new UiObject(new UiSelector().textContains("Allow")
.className("android.widget.Button"));
if (allowButton.waitForExists(timeout)) {
// Some devices request multiple permisson rights so clear them all here
while (allowButton.waitForExists(timeout)) {
allowButton.clickAndWaitForNewWindow(timeout);
}
}