Fix backup/restore instrumentation tests
This commit is contained in:
parent
88619b94c1
commit
f408381d18
2 changed files with 17 additions and 0 deletions
|
@ -72,6 +72,10 @@ internal interface LargeRestoreTestBase : LargeTestBase {
|
|||
backupListItem.clickAndWaitForNewWindow()
|
||||
waitUntilIdle()
|
||||
|
||||
waitForAppSelectionLoaded()
|
||||
// just tap next in app selection
|
||||
appsSelectedButton.clickAndWaitForNewWindow()
|
||||
|
||||
waitForInstallResult()
|
||||
|
||||
if (someAppsNotInstalledText.exists()) {
|
||||
|
@ -104,6 +108,17 @@ internal interface LargeRestoreTestBase : LargeTestBase {
|
|||
spyOnKVRestoreData(result)
|
||||
}
|
||||
|
||||
private fun waitForAppSelectionLoaded() = runBlocking {
|
||||
withContext(Dispatchers.Main) {
|
||||
withTimeout(RESTORE_TIMEOUT) {
|
||||
while (spyRestoreViewModel.selectedApps.value?.apps?.isNotEmpty() != true) {
|
||||
delay(100)
|
||||
}
|
||||
}
|
||||
}
|
||||
waitUntilIdle()
|
||||
}
|
||||
|
||||
private fun waitForInstallResult() = runBlocking {
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
|
|
|
@ -11,6 +11,8 @@ object RestoreScreen : UiDeviceScreen<RestoreScreen>() {
|
|||
|
||||
val backupListItem = findObject { textContains("Last backup") }
|
||||
|
||||
val appsSelectedButton = findObject { text("Restore backup") }
|
||||
|
||||
val nextButton = findObject { text("Next") }
|
||||
|
||||
val finishButton = findObject { text("Finish") }
|
||||
|
|
Loading…
Reference in a new issue