Testing to see if waiting for transition to end will fix flaky tests

Test: presubmit
Bug: 202735477
Change-Id: Icf62003b9f422cf0e327365260c36f6d57b71aef
This commit is contained in:
Jon Miranda
2021-11-05 12:30:10 -07:00
parent cc4a1925a6
commit a234a8ea85
3 changed files with 16 additions and 6 deletions

View File

@@ -91,9 +91,11 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
public void workTabExists() {
mDevice.pressHome();
waitForLauncherCondition("Launcher didn't start", Objects::nonNull);
waitForStableState("Launcher internal state didn't switch to Normal", () -> NORMAL);
waitForStateTransitionToEnd("Launcher internal state didn't switch to Normal",
() -> NORMAL);
executeOnLauncher(launcher -> launcher.getStateManager().goToState(ALL_APPS));
waitForStableState("Launcher internal state didn't switch to All Apps", () -> ALL_APPS);
waitForStateTransitionToEnd("Launcher internal state didn't switch to All Apps",
() -> ALL_APPS);
waitForLauncherCondition("Personal tab is missing",
launcher -> launcher.getAppsView().isPersonalTabVisible(),
LauncherInstrumentation.WAIT_TIME_MS);