Oliver.O
04/02/2026, 1:36 PMandylamax
04/03/2026, 7:02 PMOliver.O
04/03/2026, 7:17 PMandylamax
04/03/2026, 7:21 PMandylamax
04/03/2026, 7:25 PMval EmailSignInTestSuite by testSuite(displayName = "When a user opens the sign-in screen") {
academiaComposeTest("Should be able to sign in") {
goto { authentication.signIn() }
awaitUntil { element("Login").exists() }
type("<mailto:demo@academia.co.tz|demo@academia.co.tz>", into = "account")
type("<mailto:demo@academia.co.tz|demo@academia.co.tz>", into = "password")
click("Login")
awaitUntil {
engine.navigator.current().toString().endsWith("/dashboard")
}
}
}
E.g. This code snippet helps us tests
• Desktop (Minimized to a mobile screen size experience)
• Desktop (Maximized to a richer desktop experience)
• Android Mobile
• Android Tablet
• Web (Minimised to a mobile screen size)
• Web (Maximized to a richer desktop experience)
• IOS Mobile
• IOS TabletOliver.O
04/03/2026, 7:32 PMacademiaComposeTest calls runComposeUiTest, things looked like this?
class EmailSignInTestSuite {
@Test
fun When_a_user_opens_the_sign_in_screen() {
academiaComposeTest("Should be able to sign in") {
// ...
}
}
}andylamax
04/03/2026, 7:40 PMOliver.O
04/03/2026, 7:45 PMandylamax
04/03/2026, 8:03 PMandylamax
04/03/2026, 8:05 PMprivate enum class ViewPort(val width: Int, val height: Int) : WindowInfo {
Portrait(800, 1200),
Landscape(1200, 800);
override val isWindowFocused: Boolean = true
override val containerSize: IntSize = IntSize(width, height)
}
@TestRegistering
fun TestFixture.Scope<suspend ExecutionScope.(AcademiaEngine) -> Unit>.academiaComposeTest(
name: String,
start: AcademiaDestinations.() -> String = { authentication.signIn() },
action: suspend AcademiaComposeUiTest.() -> Unit
) {
val files = VirtualFileManager()
val destination = AcademiaDestinations("")
for (vp in ViewPort.entries) test("$name [${vp.name}]") { engine ->
val config = ClientConfig(
api = "",
start = destination.start(),
window = StartWindow.Desktop1024x768
)
runComposeUiTest {
setContent {
CompositionLocalProvider(LocalWindowInfo provides vp) {
val panel = rememberPanelController(engine, config, files)
MaterialTheme(typography = MarkProTypography()) {
Academia(panel, null)
}
}
}
action(AcademiaComposeUiTest(this, engine))
}
}
}
Our configuration now looks like this. Simple but very powerfulOliver.O
04/03/2026, 8:10 PMkotlin.test cannot do.
Thanks a lot! That's a good example!