mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-20 17:48:44 +00:00
Merging master into googlephotos
This commit is contained in:
commit
3b898125b0
Binary file not shown.
@ -17,7 +17,8 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
public static String TAG = "uxperf_gmail";
|
public static String TAG = "uxperf_gmail";
|
||||||
|
|
||||||
private Bundle parameters;
|
private Bundle parameters;
|
||||||
private long networkTimeout = TimeUnit.SECONDS.toMillis(20);
|
private int networkTimeoutSecs = 20;
|
||||||
|
private long networkTimeout = TimeUnit.SECONDS.toMillis(networkTimeoutSecs);
|
||||||
private LinkedHashMap<String, Timer> timingResults = new LinkedHashMap<String, Timer>();
|
private LinkedHashMap<String, Timer> timingResults = new LinkedHashMap<String, Timer>();
|
||||||
|
|
||||||
public void runUiAutomation() throws Exception {
|
public void runUiAutomation() throws Exception {
|
||||||
@ -26,10 +27,10 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
clearFirstRunDialogues();
|
clearFirstRunDialogues();
|
||||||
|
|
||||||
clickNewMail();
|
clickNewMail();
|
||||||
attachFiles();
|
|
||||||
setToField();
|
setToField();
|
||||||
setSubjectField();
|
setSubjectField();
|
||||||
setComposeField();
|
setComposeField();
|
||||||
|
attachFiles();
|
||||||
clickSendButton();
|
clickSendButton();
|
||||||
|
|
||||||
writeResultsToFile(timingResults, parameters.getString("output_file"));
|
writeResultsToFile(timingResults, parameters.getString("output_file"));
|
||||||
@ -61,7 +62,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
|
|
||||||
public void setToField() throws Exception {
|
public void setToField() throws Exception {
|
||||||
Timer result = new Timer();
|
Timer result = new Timer();
|
||||||
UiObject toField = getUiObjectByDescription("To", "android.widget.TextView");
|
UiObject toField = getUiObjectByText("To", "android.widget.TextView");
|
||||||
String recipient = parameters.getString("recipient").replace('_', ' ');
|
String recipient = parameters.getString("recipient").replace('_', ' ');
|
||||||
result.start();
|
result.start();
|
||||||
toField.setText(recipient);
|
toField.setText(recipient);
|
||||||
@ -74,6 +75,8 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
Timer result = new Timer();
|
Timer result = new Timer();
|
||||||
UiObject subjectField = getUiObjectByText("Subject", "android.widget.EditText");
|
UiObject subjectField = getUiObjectByText("Subject", "android.widget.EditText");
|
||||||
result.start();
|
result.start();
|
||||||
|
// Click on the subject field is required on some platforms to exit the To box cleanly
|
||||||
|
subjectField.click();
|
||||||
subjectField.setText("This is a test message");
|
subjectField.setText("This is a test message");
|
||||||
getUiDevice().pressEnter();
|
getUiDevice().pressEnter();
|
||||||
result.end();
|
result.end();
|
||||||
@ -97,6 +100,10 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
clickUiObject(sendButton, timeout);
|
clickUiObject(sendButton, timeout);
|
||||||
result.end();
|
result.end();
|
||||||
timingResults.put("Send", result);
|
timingResults.put("Send", result);
|
||||||
|
|
||||||
|
UiObject drawerButton = new UiObject(new UiSelector().descriptionContains("avigat")
|
||||||
|
.className("android.widget.ImageButton"));
|
||||||
|
waitObject(drawerButton, networkTimeoutSecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attachFiles() throws Exception {
|
public void attachFiles() throws Exception {
|
||||||
|
Binary file not shown.
@ -86,6 +86,9 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
getUiObjectByResourceId("com.google.android.apps.photos:id/next_button",
|
getUiObjectByResourceId("com.google.android.apps.photos:id/next_button",
|
||||||
"android.widget.ImageView");
|
"android.widget.ImageView");
|
||||||
nextButton.clickAndWaitForNewWindow();
|
nextButton.clickAndWaitForNewWindow();
|
||||||
|
|
||||||
|
UiObject workingFolder = new UiObject(new UiSelector().text("wa-working"));
|
||||||
|
waitObject(workingFolder, viewTimeoutSecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gesturesTest() throws Exception {
|
private void gesturesTest() throws Exception {
|
||||||
|
Binary file not shown.
@ -287,7 +287,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
UiObject searchBox = getUiObjectByResourceId("android:id/search_src_text",
|
UiObject searchBox = getUiObjectByResourceId("android:id/search_src_text",
|
||||||
"android.widget.EditText");
|
"android.widget.EditText");
|
||||||
searchBox.setText(searchText);
|
searchBox.setText(searchText);
|
||||||
searchBox.click();
|
getUiDevice().getInstance().pressSearch();
|
||||||
Timer result = new Timer();
|
Timer result = new Timer();
|
||||||
result.start();
|
result.start();
|
||||||
getUiDevice().getInstance().pressEnter();
|
getUiDevice().getInstance().pressEnter();
|
||||||
|
Binary file not shown.
@ -49,6 +49,7 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
|
|
||||||
// Run tests
|
// Run tests
|
||||||
handleLoginScreen(loginName, loginPass);
|
handleLoginScreen(loginName, loginPass);
|
||||||
|
confirmLocalFileAccess();
|
||||||
selectContact(contactName, contactSkypeId);
|
selectContact(contactName, contactSkypeId);
|
||||||
if ("video".equalsIgnoreCase(callType)) {
|
if ("video".equalsIgnoreCase(callType)) {
|
||||||
videoCallTest(callDuration);
|
videoCallTest(callDuration);
|
||||||
@ -76,6 +77,15 @@ public class UiAutomation extends UxPerfUiAutomation {
|
|||||||
signinButton.clickAndWaitForNewWindow();
|
signinButton.clickAndWaitForNewWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void confirmLocalFileAccess() 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)) {
|
||||||
|
allowButton.clickAndWaitForNewWindow(timeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void selectContact(String name, String id) throws Exception {
|
private void selectContact(String name, String id) throws Exception {
|
||||||
Timer timer = new Timer();
|
Timer timer = new Timer();
|
||||||
timer.start();
|
timer.start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user