aroundEachTest
fun TestConfig.aroundEachTest(executionWrappingAction: TestElementExecutionWrappingAction): TestConfig(source)
Returns a test configuration which wraps executionWrappingAction around each Test of a TestElement hierarchy.
executionWrappingAction operates on all Tests below the TestSuite it is configured for (or, if configured on a single Test, on that test).
executionWrappingAction wraps around each Test's cumulative action (a cumulative action includes all wrapping actions following this one, and the elements primary action). See TestElementExecutionWrappingAction for requirements.
Multiple aroundEach/aroundEachTest invocations nest outside-in in the order of appearance.
Notes:
If you want to wrap both, TestSuites and Tests, use aroundEachTest.
Example:
testConfig = TestConfig.aroundEachTest { action ->
repeat(5) {
action()
}
}Content copied to clipboard