Fix pip window visibility assertions

1) Fix `Could not find: PipApp`, the test previously used the launcher name, instead of the window name for assertion

2) The command previously missed a `verify` call to actually execute the assertion

Bug: 186115871
Bug: 186445782
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Ie9274e273bcda2be24491705cd28d7dc0d5ea5db
This commit is contained in:
Nataniel Borges
2021-04-29 12:02:31 +02:00
parent 4add47c730
commit 4b2f1da126

View File

@@ -65,7 +65,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
@Test
fun pipLayerBecomesVisible() {
testSpec.assertLayers {
this.isVisible(pipApp.launcherName)
this.isVisible(pipApp.windowName)
}
}
@@ -73,9 +73,11 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
@Test
fun pipWindowBecomesVisible() {
testSpec.assertWm {
invoke("pipWindowIsNotVisible") { !it.wmState.hasPipWindow() }
.then()
.invoke("pipWindowIsVisible") { it.wmState.hasPipWindow() }
invoke("pipWindowIsNotVisible") {
verify("Has no pip window").that(it.wmState.hasPipWindow()).isTrue()
}.then().invoke("pipWindowIsVisible") {
verify("Has pip window").that(it.wmState.hasPipWindow()).isTrue()
}
}
}