mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 15:12:25 +00:00 
			
		
		
		
	workloads/googleslides: Misc Fixes:
- Move the slide editing test into the main runWorkload instead of setup. - On some devices the folder picker has changed layout so add support for navigating. - Add support for differently capitalized splash buttons. - Add workaround for adding a new slide if click the button doesn't work the first time.
This commit is contained in:
		
										
											Binary file not shown.
										
									
								
							| @@ -81,11 +81,11 @@ public class UiAutomation extends BaseUiAutomation { | |||||||
|         sleep(1); |         sleep(1); | ||||||
|         enablePowerpointCompat(); |         enablePowerpointCompat(); | ||||||
|         sleep(1); |         sleep(1); | ||||||
|         testEditNewSlidesDocument(newDocumentName, workingDirectoryName, doTextEntry); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Test |     @Test | ||||||
|     public void runWorkload() throws Exception { |     public void runWorkload() throws Exception { | ||||||
|  |         testEditNewSlidesDocument(newDocumentName, workingDirectoryName, doTextEntry); | ||||||
|         openDocument(pushedDocumentName, workingDirectoryName); |         openDocument(pushedDocumentName, workingDirectoryName); | ||||||
|         waitForProgress(WAIT_TIMEOUT_1SEC*30); |         waitForProgress(WAIT_TIMEOUT_1SEC*30); | ||||||
|         testSlideshowFromStorage(slideCount); |         testSlideshowFromStorage(slideCount); | ||||||
| @@ -130,8 +130,22 @@ public class UiAutomation extends BaseUiAutomation { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void insertSlide(String slideLayout) throws Exception { |     public void insertSlide(String slideLayout) throws Exception { | ||||||
|         clickUiObject(BY_DESC, "Add slide", true); |         UiObject add_slide = | ||||||
|         clickUiObject(BY_TEXT, slideLayout, true); |                 mDevice.findObject(new UiSelector().descriptionContains("Add slide")); | ||||||
|  |         add_slide.click(); | ||||||
|  |  | ||||||
|  |         UiObject slide_layout = mDevice.findObject(new UiSelector().textContains(slideLayout)); | ||||||
|  |  | ||||||
|  |         if (!slide_layout.exists()){ | ||||||
|  |             tapOpenArea(); | ||||||
|  |             UiObject done_button = mDevice.findObject(new UiSelector().resourceId("android:id/action_mode_close_button")); | ||||||
|  |             if (done_button.exists()){ | ||||||
|  |                 done_button.click(); | ||||||
|  |             } | ||||||
|  |             add_slide.click(); | ||||||
|  |         } | ||||||
|  |         slide_layout.click(); | ||||||
|  |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void insertImage(String workingDirectoryName) throws Exception { |     public void insertImage(String workingDirectoryName) throws Exception { | ||||||
| @@ -165,7 +179,7 @@ public class UiAutomation extends BaseUiAutomation { | |||||||
|             mDevice.pressBack(); |             mDevice.pressBack(); | ||||||
|             showRoots(); |             showRoots(); | ||||||
|         } |         } | ||||||
|         if (localDevice.exists()){ |         else if (localDevice.exists()){ | ||||||
|             localDevice.click(); |             localDevice.click(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -185,6 +199,10 @@ public class UiAutomation extends BaseUiAutomation { | |||||||
|         } else { |         } else { | ||||||
|             picture.click(); |             picture.click(); | ||||||
|         } |         } | ||||||
|  |         UiObject done_button = mDevice.findObject(new UiSelector().resourceId("android:id/action_mode_close_button")); | ||||||
|  |         if (done_button.exists()){ | ||||||
|  |             done_button.click(); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void insertShape(String shapeName) throws Exception { |     public void insertShape(String shapeName) throws Exception { | ||||||
| @@ -238,18 +256,27 @@ public class UiAutomation extends BaseUiAutomation { | |||||||
|         clickUiObject(BY_TEXT, "Device storage", true); |         clickUiObject(BY_TEXT, "Device storage", true); | ||||||
|  |  | ||||||
|         UiObject workingDirectory = mDevice.findObject(new UiSelector().text(workingDirectoryName)); |         UiObject workingDirectory = mDevice.findObject(new UiSelector().text(workingDirectoryName)); | ||||||
|         if (!workingDirectory.exists()) { |         UiObject nav_button = mDevice.findObject(new UiSelector().resourceId(packageID + "file_picker_nav_up_btn")); | ||||||
|  |         UiObject folderEntry = mDevice.findObject(new UiSelector().textContains(workingDirectoryName)); | ||||||
|  |         if (workingDirectory.exists()) { | ||||||
|  |             folderEntry.clickAndWaitForNewWindow(); | ||||||
|  |         } | ||||||
|  |         else if (nav_button.exists()) { | ||||||
|  |             while (nav_button.exists()) { | ||||||
|  |                 nav_button.click(); | ||||||
|  |             } | ||||||
|  |             clickUiObject(BY_TEXT, "Internal Storage", true); | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|             showRoots(); |             showRoots(); | ||||||
|             UiObject localDevice = mDevice.findObject(new UiSelector().textMatches(".*[GM]B free")); |             UiObject localDevice = mDevice.findObject(new UiSelector().textMatches(".*[GM]B free")); | ||||||
|             localDevice.click(); |             localDevice.click(); | ||||||
|             UiObject folderEntry = mDevice.findObject(new UiSelector().textContains(workingDirectoryName)); |  | ||||||
|             UiScrollable list = new UiScrollable(new UiSelector().scrollable(true)); |             UiScrollable list = new UiScrollable(new UiSelector().scrollable(true)); | ||||||
|             if (!folderEntry.exists() && list.waitForExists(WAIT_TIMEOUT_1SEC)) { |             if (!folderEntry.exists() && list.waitForExists(WAIT_TIMEOUT_1SEC)) { | ||||||
|                 list.scrollIntoView(folderEntry); |                 list.scrollIntoView(folderEntry); | ||||||
|             } else { |             } else { | ||||||
|                 folderEntry.waitForExists(WAIT_TIMEOUT_1SEC*10); |                 folderEntry.waitForExists(WAIT_TIMEOUT_1SEC*10); | ||||||
|             } |             } | ||||||
|         folderEntry.clickAndWaitForNewWindow(); |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         UiScrollable list = |         UiScrollable list = | ||||||
| @@ -369,7 +396,7 @@ public class UiAutomation extends BaseUiAutomation { | |||||||
|  |  | ||||||
|     protected void skipWelcomeScreen() throws Exception { |     protected void skipWelcomeScreen() throws Exception { | ||||||
|         UiObject skip = |         UiObject skip = | ||||||
|             mDevice.findObject(new UiSelector().textMatches("Skip")); |             mDevice.findObject(new UiSelector().textMatches("Skip|SKIP")); | ||||||
|         if (skip.exists()) { |         if (skip.exists()) { | ||||||
|             skip.click(); |             skip.click(); | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user