testUI<U extends UIRoot> function
void
testUI<U extends UIRoot>(
- String testUIName,
- U uiRootInstantiator(
- UIElement rootContainer
- void body(
- UITestContext<
U> context
- UITestContext<
- String outputDivID = 'test-output',
- Duration initialRenderTimeout = const Duration(seconds: 5),
- SpawnHybrid? spawnHybrid,
- dynamic preSetup()?,
- dynamic posSetup(
- UITestContext<
U> context
- UITestContext<
- dynamic teardown(
- UITestContext<
U> context
- UITestContext<
Executes a group of tests using an instnatiated UIRoot.
testUIName
is the name of the test group.uiRootInstantiator
is the function that isntantiates the UIRoot.body
is the function that will declare thetest
s for the UIRoot.outputDivID
defines the ID of thediv
that will render the UIRoot.initialRenderTimeout
is the timeout for the initial render. See initializeTestUIRoot.- If
spawnHybrid
is provided it will spawn a VM isolate for the givenuri
. See functionspawnHybridUri
. preSetup
andposSetup
are optinal and are called before and after the groupsetUpAll
.teardown
is called after the grouptearDownAll
.- See UITestContext.
NOTE: all the test
s declared inside testUI are executed in the
declaration order, and if any test fails it will abort the following tests,
since the UI will be in an undefined state.
Implementation
void testUI<U extends UIRoot>(
String testUIName,
U Function(UIElement rootContainer) uiRootInstantiator,
void Function(UITestContext<U> context) body, {
String outputDivID = 'test-output',
Duration initialRenderTimeout = const Duration(seconds: 5),
SpawnHybrid? spawnHybrid,
dynamic Function()? preSetup,
dynamic Function(UITestContext<U> context)? posSetup,
dynamic Function(UITestContext<U> context)? teardown,
}) =>
_chainCapture(() => _testUIImpl(
testUIName,
uiRootInstantiator,
body,
outputDivID,
initialRenderTimeout,
spawnHybrid,
preSetup,
posSetup,
teardown));