openSessionScreen static method
Implementation
static Future<void> openSessionScreen(
WidgetTester tester,
EnsembleTestCase testCase,
) async {
final startScreen = testCase.startScreen;
if (startScreen == null || startScreen.isEmpty) {
throw EnsembleTestFailure(
'Session test "${testCase.id}" requires startScreen',
);
}
final context = Utils.globalAppKey.currentContext;
if (context == null) {
throw EnsembleTestFailure(
'Cannot open "$startScreen" because the saved app session is not mounted',
);
}
ScreenTracker().clearAll();
YamlTestSession.navigationFlow.clear();
ScreenController().navigateToScreen(
context,
screenId: startScreen,
pageArgs: testCase.startScreenInputs,
routeOption: RouteOption.clearAllScreens,
);
await tester.pump();
await waitForInitialWidgets(tester, testCase: testCase);
}