testScreenUI function
- @isTestGroup
- Object description,
- Future<
Widget> createScreen(), { - Future<
void> onTest(- WidgetTester tester
- String? goldenDir,
- TestScreenConfig? config,
- UITargetPlatform? onlyPlatform,
Use this function for testing custom StatelessWidgets and StatefulWidgets that represent screens.
description
is a test description.
createScreen
is a callback function that creates the screen to test.
onTest
is a callback function called after the screen creation.
Use it to change the state of your screen.
goldenDir
is the name of the subdirectory created inside the screens directory
when the golden files are created.
config
use this config instead of the global configuration defined by initializeDefaultTestScreenConfig.
onlyPlatform
execute the tests only for the platform specified, ignoring the specified
on config
or initializeDefaultTestScreenConfig.
Implementation
@isTestGroup
void testScreenUI(Object description, Future<Widget> Function() createScreen,
{Future<void> Function(WidgetTester tester)? onTest,
String? goldenDir,
TestScreenConfig? config,
UITargetPlatform? onlyPlatform}) async {
_internalTestScreen(description, createScreen, onTest,
config: config,
onlyPlatform: onlyPlatform,
testUI: true,
uiGolderDir: goldenDir);
}