roboelectricTestSuite

fun TestSuiteScope.roboelectricTestSuite(name: String, content: KClass<out RoboelectricTestSuiteContent>, arguments: Array<Any> = arrayOf(), testConfig: TestConfig = TestConfig)(source)

Registers a Roboelectric test suite as a child of the TestSuiteScope.testSuiteInScope.

The test suite's content resides in a separate RoboelectricTestSuiteContent class which will be dynamically loaded by the Roboelectric Sandbox class loader for instrumentation.

Optionally, arguments can be provided for the content constructor's parameters, if it has any.

Note: arguments is the boundary where types and values travel between the "normal" JVM world and the Roboelectric environment. By default, Roboelectric will re-load all classes it encounters with its own sandbox class loader, making them incompatible with the "same" classes in the JVM world. To make a class MyType and all classes in com.example.mypackage portable between those worlds, add the following testConfig parameter to the roboelectricTestSuite invocation or anywhere above it in the test element hierarchy:

testConfig = TestConfig.roboelectric {
portableClasses += MyType::class
portablePackages += "com.example.mypackage"
}