Fix flaky assertion

Sometimes, when quick switching between apps, the previous app is restarted (e.g., it was stopped by the OS to release memory). Because of this, the app launch creates a SnapshotStartingWindow before the secondary app is visible again. So we now check if this is visible if the Window itself isn't yet.

Test: atest FlickerTests SwitchImeWindowsFromGestureNavTest#imeAppWindowVisibility

Bug: 208628307
Change-Id: I1cc48da5f1dd9ad78b8565a0028272dd3b985a39
This commit is contained in:
Pablo Gamito
2021-12-03 01:22:42 +01:00
parent 41bab72cc2
commit cd35590771

View File

@@ -107,9 +107,13 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame
fun imeAppWindowVisibility() {
testSpec.assertWm {
isAppWindowVisible(imeTestApp.component)
.then()
.isAppSnapshotStartingWindowVisibleFor(testApp.component, isOptional = true)
.then()
.isAppWindowVisible(testApp.component)
.then()
.isAppSnapshotStartingWindowVisibleFor(imeTestApp.component, isOptional = true)
.then()
.isAppWindowVisible(imeTestApp.component)
}
}