JUnit4RulesContext

A context for a test-level fixture handling JUnit 4 rules.

Each JUnit 4 TestRule registered in this context via the rule method will be applied to a test.

Usage:

testFixture {
object : JUnit4RulesContext() {
val composeTestRule = rule(createComposeRule())
// other rules or regular properties...
}
} asContextForEach {
test("setup") {
composeTestRule.setContent {
ComposableUnderTest()
}
}
}

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun execute(test: Test, elementAction: () -> Unit)

Executes the envelope's blocking code, and the elementAction wrapped inside.

Link copied to clipboard
fun <Rule : TestRule> rule(rule: Rule): Rule

Registers a JUnit4 rule.