From 0593b9c60f51c87c3be983a7e5e73e7393fb7d0f Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Mon, 8 Jun 2026 15:45:17 +0200 Subject: [PATCH] test: add UI smoke test for MainActivity placeholder createAndroidComposeRule() launches the activity in the test process and verifies both app_name and app_tagline texts render on the placeholder screen. Uses JUnit 4 + AndroidJUnit4 runner - instrumented tests on Android still don't support JUnit Jupiter. Test compiles (assembleDebugAndroidTest passes); execution requires an emulator/device, performed in CI. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../calendula/MainActivitySmokeTest.kt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/src/androidTest/java/de/jeanlucmakiola/calendula/MainActivitySmokeTest.kt diff --git a/app/src/androidTest/java/de/jeanlucmakiola/calendula/MainActivitySmokeTest.kt b/app/src/androidTest/java/de/jeanlucmakiola/calendula/MainActivitySmokeTest.kt new file mode 100644 index 0000000..df1cc92 --- /dev/null +++ b/app/src/androidTest/java/de/jeanlucmakiola/calendula/MainActivitySmokeTest.kt @@ -0,0 +1,26 @@ +package de.jeanlucmakiola.calendula + +import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.junit4.createAndroidComposeRule +import androidx.compose.ui.test.onNodeWithText +import androidx.test.ext.junit.runners.AndroidJUnit4 +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4::class) +class MainActivitySmokeTest { + + @get:Rule + val composeTestRule = createAndroidComposeRule() + + @Test + fun appName_isDisplayed_onLaunch() { + composeTestRule.onNodeWithText("Calendula").assertIsDisplayed() + } + + @Test + fun tagline_isDisplayed_onLaunch() { + composeTestRule.onNodeWithText("A modern calendar.").assertIsDisplayed() + } +}