diff --git a/tests/src/com/android/launcher3/ui/WorkTabTest.java b/tests/src/com/android/launcher3/ui/WorkTabTest.java index ac0d355704..aef26ae3d0 100644 --- a/tests/src/com/android/launcher3/ui/WorkTabTest.java +++ b/tests/src/com/android/launcher3/ui/WorkTabTest.java @@ -150,11 +150,15 @@ public class WorkTabTest extends AbstractLauncherUiTest { waitForLauncherCondition("Launcher did not show the next edu screen", l -> { Log.d(TestProtocol.WORK_PROFILE_REMOVED, "running test attempt" + attempt.getAndIncrement()); + if (!(l.getAppsView().getContentView() instanceof AllAppsPagedView)) { + Log.d(TestProtocol.WORK_PROFILE_REMOVED, "Work tab not setup. Skipping test"); + return false; + } return ((AllAppsPagedView) l.getAppsView().getContentView()).getCurrentPage() == WORK_PAGE && ((TextView) workEduView.findViewById( R.id.content_text)).getText().equals( l.getResources().getString(R.string.work_profile_edu_work_apps)); - }); + }, 60000); } @Test