aroundEach
fun TestConfig.aroundEach(executionWrappingAction: TestElementExecutionWrappingAction): TestConfig(source)
Returns a test configuration which wraps executionWrappingAction around each element of a TestElement hierarchy.
executionWrappingAction operates on the TestElement it is configured for and all elements below it. executionWrappingAction wraps around each TestElement's cumulative action (a cumulative action includes all wrapping actions following this one, and the elements primary action). See TestElementExecutionWrappingAction for requirements.
Multiple aroundEach invocations nest outside-in in the order of appearance.
Notes:
If you want to wrap Tests exclusively, use aroundEachTest.
If you need an aroundEach wrapper with a shared context, use TestConfig.traversal.
Example:
testConfig = TestConfig.aroundEach { elementAction ->
println("$elementPath aroundEach entering")
elementAction()
println("$elementPath aroundEach exiting")
}Content copied to clipboard