mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 07:04:17 +00:00 
			
		
		
		
	More fixes to Reader/Gmail/Photos to improve reliability across devices
This commit is contained in:
		
										
											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.
										
									
								
							| @@ -84,6 +84,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(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user