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.
testUINameis the name of the test group.uiRootInstantiatoris the function that isntantiates the UIRoot.bodyis the function that will declare thetests for the UIRoot.outputDivIDdefines the ID of thedivthat will render the UIRoot.initialRenderTimeoutis the timeout for the initial render. See initializeTestUIRoot.- If
spawnHybridis provided it will spawn a VM isolate for the givenuri. See functionspawnHybridUri. preSetupandposSetupare optinal and are called before and after the groupsetUpAll.teardownis called after the grouptearDownAll.- See UITestContext.
NOTE: all the tests 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));