E2ETestLifecycle
interface E2ETestLifecycle
Interface providing per-test scenario lifecycle hooks for a test class.
Implement this interface on your test class to automatically execute setup and teardown logic before and after every e2eTest block in that class.
Example Usage
class FormIntegrationTest : E2ETestLifecycle {
override suspend fun E2ETestScope.beforeEach() {
// Automatically executes before every test block in this class
navigateToSection("form_playground")
assertVisible("form_playground_screen")
}
override suspend fun E2ETestScope.afterEach() {
// Automatically executes after every test block completes (success or failure)
navigateToSection("home_screen")
}
@Test
fun testFormSubmission() = e2eTest {
input("form_name_input", "Alex")
click("Submit")
assertVisible("success_message")
}
}Content copied to clipboard
See also
Functions
Link copied to clipboard
Executes inside the active E2ETestScope after every test scenario completes (success or failure).
Link copied to clipboard
Executes inside the active E2ETestScope before every test scenario runs.