Skip to content

Commit

Permalink
Fix backup/restore instrumentation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed May 31, 2024
1 parent 1beebdc commit bcc9922
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ internal interface LargeRestoreTestBase : LargeTestBase {
backupListItem.clickAndWaitForNewWindow()
waitUntilIdle()

waitForAppSelectionLoaded()
// just tap next in app selection
nextButton.clickAndWaitForNewWindow()

waitForInstallResult()

if (someAppsNotInstalledText.exists()) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit bcc9922

Please sign in to comment.