From b2140ad60a5425de619175c240ab9da0c14de6ce Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Sat, 16 May 2026 04:31:11 +0200 Subject: [PATCH 1/9] test: add android test lanes --- app/build.gradle.kts | 60 +++++++++++++++++++ .../to/bitkit/data/keychain/KeychainTest.kt | 4 ++ .../java/to/bitkit/services/BlocktankTest.kt | 4 ++ .../to/bitkit/services/OnchainServiceTests.kt | 4 ++ .../services/RoutingFeeEstimationTest.kt | 4 ++ .../java/to/bitkit/services/TxBumpingTests.kt | 4 ++ .../to/bitkit/services/UtxoSelectionTests.kt | 4 ++ .../bitkit/test/annotations/ComposeUiTest.kt | 5 ++ .../annotations/CoreServiceIntegrationTest.kt | 5 ++ .../test/annotations/DeviceIntegrationTest.kt | 5 ++ .../DeviceStorageIntegrationTest.kt | 5 ++ .../annotations/DeviceUiIntegrationTest.kt | 5 ++ .../wallets/send/SendAmountContentTest.kt | 2 + .../screens/widgets/blocks/BlockCardTest.kt | 2 + .../ui/screens/widgets/facts/FactsCardTest.kt | 2 + .../widgets/facts/FactsPreviewScreenTest.kt | 2 + .../widgets/headlines/HeadlineCardTest.kt | 2 + .../headlines/HeadlinesEditContentTest.kt | 2 + .../headlines/HeadlinesPreviewContentTest.kt | 2 + .../widgets/weather/WeatherCardTest.kt | 2 + .../widgets/weather/WeatherEditScreenTest.kt | 2 + .../weather/WeatherPreviewScreenTest.kt | 2 + .../settings/backups/BackupIntroScreenTest.kt | 2 + .../quickPay/QuickPaySettingsScreenTest.kt | 2 + .../settings/support/ReportIssueScreenTest.kt | 2 + .../ui/sheets/BoostTransactionSheetTest.kt | 2 + .../ui/sheets/NewTransactionSheetViewTest.kt | 2 + 27 files changed, 139 insertions(+) create mode 100644 app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiTest.kt create mode 100644 app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationTest.kt create mode 100644 app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationTest.kt create mode 100644 app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationTest.kt create mode 100644 app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationTest.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b6fcb3b2da..5aa7e245f4 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -50,6 +50,33 @@ val e2eBackendEnv = System.getenv("E2E_BACKEND") ?: "local" val e2eHomegateUrlEnv = System.getenv("E2E_HOMEGATE_URL") ?: "http://127.0.0.1:6288" val trezorBridgeEnv = System.getenv("TREZOR_BRIDGE")?.toBoolean()?.toString() ?: "false" val trezorBridgeUrlEnv = System.getenv("TREZOR_BRIDGE_URL") ?: "http://10.0.2.2:21325" +val coreServiceIntegrationTestAnnotation = "to.bitkit.test.annotations.CoreServiceIntegrationTest" +val composeUiTestAnnotation = "to.bitkit.test.annotations.ComposeUiTest" +val deviceIntegrationTestAnnotation = "to.bitkit.test.annotations.DeviceIntegrationTest" +val deviceStorageIntegrationTestAnnotation = "to.bitkit.test.annotations.DeviceStorageIntegrationTest" +val deviceUiIntegrationTestAnnotation = "to.bitkit.test.annotations.DeviceUiIntegrationTest" +val requestedTaskNames = gradle.startParameter.taskNames.map { it.substringAfterLast(":") } +val bitkitAndroidTestSuite = providers.gradleProperty("bitkitAndroidTestSuite").orNull +val bitkitAndroidTestAnnotation = when { + requestedTaskNames.any { it == "connectedDevDebugComposeAndroidTest" } -> composeUiTestAnnotation + requestedTaskNames.any { it == "connectedDevDebugCoreServiceIntegrationAndroidTest" } -> { + coreServiceIntegrationTestAnnotation + } + requestedTaskNames.any { it == "connectedDevDebugDeviceStorageIntegrationAndroidTest" } -> { + deviceStorageIntegrationTestAnnotation + } + requestedTaskNames.any { it == "connectedDevDebugDeviceUiIntegrationAndroidTest" } -> { + deviceUiIntegrationTestAnnotation + } + requestedTaskNames.any { it == "connectedDevDebugDeviceIntegrationAndroidTest" } -> deviceIntegrationTestAnnotation + bitkitAndroidTestSuite == "compose" -> composeUiTestAnnotation + bitkitAndroidTestSuite == "core-service" -> coreServiceIntegrationTestAnnotation + bitkitAndroidTestSuite == "device-storage" -> deviceStorageIntegrationTestAnnotation + bitkitAndroidTestSuite == "device-ui" -> deviceUiIntegrationTestAnnotation + bitkitAndroidTestSuite == "integration" -> deviceIntegrationTestAnnotation + bitkitAndroidTestSuite == null -> null + else -> error("Unsupported bitkitAndroidTestSuite '$bitkitAndroidTestSuite'") +} android { namespace = "to.bitkit" @@ -61,6 +88,9 @@ android { versionCode = 181 versionName = "2.2.0" testInstrumentationRunner = "to.bitkit.test.HiltTestRunner" + bitkitAndroidTestAnnotation?.let { + testInstrumentationRunnerArguments["annotation"] = it + } vectorDrawables { useSupportLibrary = true } @@ -367,4 +397,34 @@ tasks.withType().configureEach { jvmArgs("-XX:+EnableDynamicAgentLoading") } +tasks.register("connectedDevDebugComposeAndroidTest") { + group = "verification" + description = "Runs devDebug Android tests annotated as Compose UI tests." + dependsOn("connectedDevDebugAndroidTest") +} + +tasks.register("connectedDevDebugDeviceIntegrationAndroidTest") { + group = "verification" + description = "Runs devDebug Android tests annotated as device integration tests." + dependsOn("connectedDevDebugAndroidTest") +} + +tasks.register("connectedDevDebugCoreServiceIntegrationAndroidTest") { + group = "verification" + description = "Runs devDebug Android tests annotated as core service integration tests." + dependsOn("connectedDevDebugAndroidTest") +} + +tasks.register("connectedDevDebugDeviceStorageIntegrationAndroidTest") { + group = "verification" + description = "Runs devDebug Android tests annotated as device storage integration tests." + dependsOn("connectedDevDebugAndroidTest") +} + +tasks.register("connectedDevDebugDeviceUiIntegrationAndroidTest") { + group = "verification" + description = "Runs devDebug Android tests annotated as device UI integration tests." + dependsOn("connectedDevDebugAndroidTest") +} + // endregion diff --git a/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt b/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt index 206adabe52..0634954d39 100644 --- a/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt +++ b/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt @@ -14,12 +14,16 @@ import org.junit.runner.RunWith import to.bitkit.data.AppDb import to.bitkit.data.entities.ConfigEntity import to.bitkit.test.BaseAndroidTest +import to.bitkit.test.annotations.DeviceIntegrationTest +import to.bitkit.test.annotations.DeviceStorageIntegrationTest import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertNull import kotlin.test.assertTrue @RunWith(AndroidJUnit4::class) +@DeviceIntegrationTest +@DeviceStorageIntegrationTest class KeychainTest : BaseAndroidTest() { private val appContext by lazy { ApplicationProvider.getApplicationContext() } diff --git a/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt b/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt index dafbce5e2d..00bff76860 100644 --- a/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt +++ b/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt @@ -15,6 +15,8 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import to.bitkit.env.Env +import to.bitkit.test.annotations.CoreServiceIntegrationTest +import to.bitkit.test.annotations.DeviceIntegrationTest import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertNotEquals @@ -22,6 +24,8 @@ import kotlin.test.assertNotNull import kotlin.test.assertTrue @HiltAndroidTest +@DeviceIntegrationTest +@CoreServiceIntegrationTest class BlocktankTest { @get:Rule var hiltRule = HiltAndroidRule(this) diff --git a/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt b/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt index 706f868725..dd0e891df9 100644 --- a/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt @@ -8,11 +8,15 @@ import org.junit.Test import org.junit.runner.RunWith import org.lightningdevkit.ldknode.Network import to.bitkit.models.toDerivationPath +import to.bitkit.test.annotations.CoreServiceIntegrationTest +import to.bitkit.test.annotations.DeviceIntegrationTest import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertTrue @RunWith(AndroidJUnit4::class) +@DeviceIntegrationTest +@CoreServiceIntegrationTest class OnchainServiceTests { private lateinit var onchainService: OnchainService diff --git a/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt b/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt index c707257347..fae997f559 100644 --- a/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt +++ b/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt @@ -18,6 +18,8 @@ import to.bitkit.data.CacheStore import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo +import to.bitkit.test.annotations.CoreServiceIntegrationTest +import to.bitkit.test.annotations.DeviceIntegrationTest import to.bitkit.utils.LdkError import javax.inject.Inject import kotlin.test.assertEquals @@ -27,6 +29,8 @@ import kotlin.test.assertTrue @HiltAndroidTest @RunWith(AndroidJUnit4::class) +@DeviceIntegrationTest +@CoreServiceIntegrationTest class RoutingFeeEstimationTest { companion object { diff --git a/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt b/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt index e46347f454..6206efd1e2 100644 --- a/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt @@ -15,6 +15,8 @@ import org.junit.runner.RunWith import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo +import to.bitkit.test.annotations.CoreServiceIntegrationTest +import to.bitkit.test.annotations.DeviceIntegrationTest import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -23,6 +25,8 @@ import kotlin.test.assertTrue @HiltAndroidTest @RunWith(AndroidJUnit4::class) +@DeviceIntegrationTest +@CoreServiceIntegrationTest class TxBumpingTests { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt b/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt index e239093ce6..2b9d9cc0fc 100644 --- a/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt @@ -16,6 +16,8 @@ import org.lightningdevkit.ldknode.CoinSelectionAlgorithm import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo +import to.bitkit.test.annotations.CoreServiceIntegrationTest +import to.bitkit.test.annotations.DeviceIntegrationTest import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -25,6 +27,8 @@ import kotlin.test.fail @HiltAndroidTest @RunWith(AndroidJUnit4::class) +@DeviceIntegrationTest +@CoreServiceIntegrationTest class UtxoSelectionTests { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiTest.kt new file mode 100644 index 0000000000..0b7581810e --- /dev/null +++ b/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiTest.kt @@ -0,0 +1,5 @@ +package to.bitkit.test.annotations + +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +annotation class ComposeUiTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationTest.kt new file mode 100644 index 0000000000..f36be5a1cc --- /dev/null +++ b/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationTest.kt @@ -0,0 +1,5 @@ +package to.bitkit.test.annotations + +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +annotation class CoreServiceIntegrationTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationTest.kt new file mode 100644 index 0000000000..d3fe905adf --- /dev/null +++ b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationTest.kt @@ -0,0 +1,5 @@ +package to.bitkit.test.annotations + +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +annotation class DeviceIntegrationTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationTest.kt new file mode 100644 index 0000000000..2a99d5c581 --- /dev/null +++ b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationTest.kt @@ -0,0 +1,5 @@ +package to.bitkit.test.annotations + +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +annotation class DeviceStorageIntegrationTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationTest.kt new file mode 100644 index 0000000000..de2a9f00c7 --- /dev/null +++ b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationTest.kt @@ -0,0 +1,5 @@ +package to.bitkit.test.annotations + +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +annotation class DeviceUiIntegrationTest diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt index b0f6392b9a..cfae877313 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt @@ -7,10 +7,12 @@ import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test import to.bitkit.models.NodeLifecycleState +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.viewmodels.SendMethod import to.bitkit.viewmodels.SendUiState import to.bitkit.viewmodels.previewAmountInputViewModel +@ComposeUiTest class SendAmountContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt index 323ddec06b..b6f2d5247f 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt @@ -5,8 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class BlockCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt index 5b7cdafad5..4465a79db4 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt @@ -5,8 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class FactsCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt index 2905c0d7c1..d222a1443c 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt @@ -5,8 +5,10 @@ import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class FactsPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt index 457eaa3419..7f6bf4e2c3 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt @@ -5,8 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class HeadlineCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt index b3ff9239e0..5b537d1e29 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt @@ -9,8 +9,10 @@ import org.junit.Rule import org.junit.Test import to.bitkit.models.widget.ArticleModel import to.bitkit.models.widget.HeadlinePreferences +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class HeadlinesEditContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt index e7b6ec8e1a..8b2f83c4ff 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt @@ -7,8 +7,10 @@ import org.junit.Rule import org.junit.Test import to.bitkit.models.widget.ArticleModel import to.bitkit.models.widget.HeadlinePreferences +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class HeadlinesPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt index afdc713360..a6be686808 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt @@ -9,9 +9,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class WeatherCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt index 2854d79746..87ea27ea09 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt @@ -11,9 +11,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class WeatherEditScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt index 5804af8363..2d9f4832ff 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt @@ -9,9 +9,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class WeatherPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt index d3730264e0..7d5c6137bd 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt @@ -5,8 +5,10 @@ import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class BackupIntroScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt index 39fa168f28..28047ed00f 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt @@ -9,9 +9,11 @@ import dagger.hilt.android.testing.HiltAndroidTest import org.junit.Before import org.junit.Rule import org.junit.Test +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface @HiltAndroidTest +@ComposeUiTest class QuickPaySettingsScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt index d7e9f2c2b7..a6ca7db6e5 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt @@ -8,8 +8,10 @@ import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performTextInput import org.junit.Rule import org.junit.Test +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.theme.AppThemeSurface +@ComposeUiTest class ReportIssueContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt b/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt index 60da21a7d0..af4e931d4e 100644 --- a/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt @@ -20,6 +20,7 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith +import to.bitkit.test.annotations.ComposeUiTest import to.bitkit.ui.sheets.BoostTransactionContent import to.bitkit.ui.sheets.BoostTransactionTestTags import to.bitkit.ui.sheets.BoostTransactionUiState @@ -28,6 +29,7 @@ import to.bitkit.ui.theme.AppThemeSurface @HiltAndroidTest @RunWith(AndroidJUnit4::class) +@ComposeUiTest class BoostTransactionContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt b/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt index 5a7769d36f..065a1b99b4 100644 --- a/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt @@ -11,8 +11,10 @@ import org.junit.Test import to.bitkit.models.NewTransactionSheetDetails import to.bitkit.models.NewTransactionSheetDirection import to.bitkit.models.NewTransactionSheetType +import to.bitkit.test.annotations.ComposeUiTest @HiltAndroidTest +@ComposeUiTest class NewTransactionSheetViewTest { @get:Rule From f94d245933775549ed416f2313dd111189f123f1 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Sat, 16 May 2026 13:12:19 +0200 Subject: [PATCH 2/9] ci: add android test suite input --- .github/workflows/ui-tests.yml | 44 +++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index c2f5272c6d..f1162229f9 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -5,6 +5,12 @@ on: branches: [ "master" ] workflow_dispatch: + inputs: + suites: + description: "Android test suites: all or comma-separated annotations/suites" + required: false + default: "all" + type: string concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -81,6 +87,8 @@ jobs: - name: Run UI tests on Android Emulator uses: reactivecircus/android-emulator-runner@v2 + env: + ANDROID_TEST_SUITES: ${{ github.event.inputs.suites || 'all' }} with: api-level: 30 arch: x86_64 @@ -101,7 +109,41 @@ jobs: # Install and run tests ./gradlew installDevDebug - ./gradlew connectedDevDebugAndroidTest + + suites="${ANDROID_TEST_SUITES:-all}" + suites="$(echo "$suites" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')" + + if [[ -z "$suites" || "$suites" == "all" ]]; then + ./gradlew connectedDevDebugAndroidTest + exit 0 + fi + + IFS=',' read -ra requested_suites <<< "$suites" + for suite in "${requested_suites[@]}"; do + case "$suite" in + compose|compose-ui|composeuitest|to.bitkit.test.annotations.composeuitest) + task="connectedDevDebugComposeAndroidTest" + ;; + device|device-integration|deviceintegrationtest|to.bitkit.test.annotations.deviceintegrationtest) + task="connectedDevDebugDeviceIntegrationAndroidTest" + ;; + core|core-service|coreserviceintegrationtest|to.bitkit.test.annotations.coreserviceintegrationtest) + task="connectedDevDebugCoreServiceIntegrationAndroidTest" + ;; + storage|device-storage|devicestorageintegrationtest|to.bitkit.test.annotations.devicestorageintegrationtest) + task="connectedDevDebugDeviceStorageIntegrationAndroidTest" + ;; + ui|device-ui|deviceuiintegrationtest|to.bitkit.test.annotations.deviceuiintegrationtest) + task="connectedDevDebugDeviceUiIntegrationAndroidTest" + ;; + *) + echo "::error::Unknown Android test suite '$suite'. Use all, compose, device-integration, core-service, device-storage, or device-ui." + exit 1 + ;; + esac + + ./gradlew "$task" + done - name: Upload UI test report if: always() From 5d6e2aab095cfef1fa108cd984b5eed50fee6abb Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Sat, 16 May 2026 15:30:54 +0200 Subject: [PATCH 3/9] ci: simplify android test input --- .github/workflows/ui-tests.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index f1162229f9..0717baf284 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: suites: - description: "Android test suites: all or comma-separated annotations/suites" + description: "Android test annotations: all or comma-separated simple annotation names" required: false default: "all" type: string @@ -111,7 +111,7 @@ jobs: ./gradlew installDevDebug suites="${ANDROID_TEST_SUITES:-all}" - suites="$(echo "$suites" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')" + suites="$(echo "$suites" | tr -d '[:space:]')" if [[ -z "$suites" || "$suites" == "all" ]]; then ./gradlew connectedDevDebugAndroidTest @@ -121,23 +121,23 @@ jobs: IFS=',' read -ra requested_suites <<< "$suites" for suite in "${requested_suites[@]}"; do case "$suite" in - compose|compose-ui|composeuitest|to.bitkit.test.annotations.composeuitest) + ComposeUiTest) task="connectedDevDebugComposeAndroidTest" ;; - device|device-integration|deviceintegrationtest|to.bitkit.test.annotations.deviceintegrationtest) + DeviceIntegrationTest) task="connectedDevDebugDeviceIntegrationAndroidTest" ;; - core|core-service|coreserviceintegrationtest|to.bitkit.test.annotations.coreserviceintegrationtest) + CoreServiceIntegrationTest) task="connectedDevDebugCoreServiceIntegrationAndroidTest" ;; - storage|device-storage|devicestorageintegrationtest|to.bitkit.test.annotations.devicestorageintegrationtest) + DeviceStorageIntegrationTest) task="connectedDevDebugDeviceStorageIntegrationAndroidTest" ;; - ui|device-ui|deviceuiintegrationtest|to.bitkit.test.annotations.deviceuiintegrationtest) + DeviceUiIntegrationTest) task="connectedDevDebugDeviceUiIntegrationAndroidTest" ;; *) - echo "::error::Unknown Android test suite '$suite'. Use all, compose, device-integration, core-service, device-storage, or device-ui." + echo "::error::Unknown Android test annotation '$suite'. Use all, ComposeUiTest, DeviceIntegrationTest, CoreServiceIntegrationTest, DeviceStorageIntegrationTest, or DeviceUiIntegrationTest." exit 1 ;; esac From 926213994967ba400ef024d6827cdfa5580ac198 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Sat, 16 May 2026 15:36:33 +0200 Subject: [PATCH 4/9] ci: derive android test lanes --- .github/workflows/ui-tests.yml | 29 ++---- app/build.gradle.kts | 95 +++++++++---------- .../to/bitkit/data/keychain/KeychainTest.kt | 8 +- .../java/to/bitkit/services/BlocktankTest.kt | 8 +- .../to/bitkit/services/OnchainServiceTests.kt | 8 +- .../services/RoutingFeeEstimationTest.kt | 8 +- .../java/to/bitkit/services/TxBumpingTests.kt | 8 +- .../to/bitkit/services/UtxoSelectionTests.kt | 8 +- ...mposeUiTest.kt => ComposeUiAndroidTest.kt} | 2 +- ...t => CoreServiceIntegrationAndroidTest.kt} | 2 +- ...est.kt => DeviceIntegrationAndroidTest.kt} | 2 +- .../DeviceStorageIntegrationAndroidTest.kt | 5 + ...t.kt => DeviceUiIntegrationAndroidTest.kt} | 2 +- .../annotations/DeviceUiIntegrationTest.kt | 5 - .../wallets/send/SendAmountContentTest.kt | 4 +- .../screens/widgets/blocks/BlockCardTest.kt | 4 +- .../ui/screens/widgets/facts/FactsCardTest.kt | 4 +- .../widgets/facts/FactsPreviewScreenTest.kt | 4 +- .../widgets/headlines/HeadlineCardTest.kt | 4 +- .../headlines/HeadlinesEditContentTest.kt | 4 +- .../headlines/HeadlinesPreviewContentTest.kt | 4 +- .../widgets/weather/WeatherCardTest.kt | 4 +- .../widgets/weather/WeatherEditScreenTest.kt | 4 +- .../weather/WeatherPreviewScreenTest.kt | 4 +- .../settings/backups/BackupIntroScreenTest.kt | 4 +- .../quickPay/QuickPaySettingsScreenTest.kt | 4 +- .../settings/support/ReportIssueScreenTest.kt | 4 +- .../ui/sheets/BoostTransactionSheetTest.kt | 4 +- .../ui/sheets/NewTransactionSheetViewTest.kt | 4 +- 29 files changed, 113 insertions(+), 137 deletions(-) rename app/src/androidTest/java/to/bitkit/test/annotations/{ComposeUiTest.kt => ComposeUiAndroidTest.kt} (78%) rename app/src/androidTest/java/to/bitkit/test/annotations/{DeviceStorageIntegrationTest.kt => CoreServiceIntegrationAndroidTest.kt} (72%) rename app/src/androidTest/java/to/bitkit/test/annotations/{CoreServiceIntegrationTest.kt => DeviceIntegrationAndroidTest.kt} (74%) create mode 100644 app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationAndroidTest.kt rename app/src/androidTest/java/to/bitkit/test/annotations/{DeviceIntegrationTest.kt => DeviceUiIntegrationAndroidTest.kt} (73%) delete mode 100644 app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationTest.kt diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 0717baf284..7ef233578e 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -120,29 +120,12 @@ jobs: IFS=',' read -ra requested_suites <<< "$suites" for suite in "${requested_suites[@]}"; do - case "$suite" in - ComposeUiTest) - task="connectedDevDebugComposeAndroidTest" - ;; - DeviceIntegrationTest) - task="connectedDevDebugDeviceIntegrationAndroidTest" - ;; - CoreServiceIntegrationTest) - task="connectedDevDebugCoreServiceIntegrationAndroidTest" - ;; - DeviceStorageIntegrationTest) - task="connectedDevDebugDeviceStorageIntegrationAndroidTest" - ;; - DeviceUiIntegrationTest) - task="connectedDevDebugDeviceUiIntegrationAndroidTest" - ;; - *) - echo "::error::Unknown Android test annotation '$suite'. Use all, ComposeUiTest, DeviceIntegrationTest, CoreServiceIntegrationTest, DeviceStorageIntegrationTest, or DeviceUiIntegrationTest." - exit 1 - ;; - esac - - ./gradlew "$task" + if [[ "$suite" == *.* || ! "$suite" =~ ^[A-Z][A-Za-z0-9]*AndroidTest$ ]]; then + echo "::error::Invalid Android test annotation '$suite'. Use all or comma-separated simple annotation names such as DeviceUiIntegrationAndroidTest." + exit 1 + fi + + ./gradlew connectedDevDebugAndroidTest -PbitkitAndroidTestAnnotation="$suite" done - name: Upload UI test report diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5aa7e245f4..369306f0bd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -50,32 +50,47 @@ val e2eBackendEnv = System.getenv("E2E_BACKEND") ?: "local" val e2eHomegateUrlEnv = System.getenv("E2E_HOMEGATE_URL") ?: "http://127.0.0.1:6288" val trezorBridgeEnv = System.getenv("TREZOR_BRIDGE")?.toBoolean()?.toString() ?: "false" val trezorBridgeUrlEnv = System.getenv("TREZOR_BRIDGE_URL") ?: "http://10.0.2.2:21325" -val coreServiceIntegrationTestAnnotation = "to.bitkit.test.annotations.CoreServiceIntegrationTest" -val composeUiTestAnnotation = "to.bitkit.test.annotations.ComposeUiTest" -val deviceIntegrationTestAnnotation = "to.bitkit.test.annotations.DeviceIntegrationTest" -val deviceStorageIntegrationTestAnnotation = "to.bitkit.test.annotations.DeviceStorageIntegrationTest" -val deviceUiIntegrationTestAnnotation = "to.bitkit.test.annotations.DeviceUiIntegrationTest" -val requestedTaskNames = gradle.startParameter.taskNames.map { it.substringAfterLast(":") } -val bitkitAndroidTestSuite = providers.gradleProperty("bitkitAndroidTestSuite").orNull -val bitkitAndroidTestAnnotation = when { - requestedTaskNames.any { it == "connectedDevDebugComposeAndroidTest" } -> composeUiTestAnnotation - requestedTaskNames.any { it == "connectedDevDebugCoreServiceIntegrationAndroidTest" } -> { - coreServiceIntegrationTestAnnotation +val androidTestAnnotationPackage = "to.bitkit.test.annotations" +val androidTestAnnotationSuffix = "AndroidTest" +val androidTestTaskPrefix = "connectedDevDebug" +val androidTestTaskSuffix = "AndroidTest" +val androidTestAnnotationNames = file("src/androidTest/java/to/bitkit/test/annotations") + .listFiles() + ?.mapNotNull { file -> + file.nameWithoutExtension.takeIf { + file.isFile && + file.extension == "kt" && + it.endsWith(androidTestAnnotationSuffix) + } } - requestedTaskNames.any { it == "connectedDevDebugDeviceStorageIntegrationAndroidTest" } -> { - deviceStorageIntegrationTestAnnotation + ?.sorted() + .orEmpty() +val requestedTaskNames = gradle.startParameter.taskNames.map { it.substringAfterLast(":") } + +fun androidTestTaskName(annotationName: String): String { + val taskInfix = annotationName.removeSuffix(androidTestAnnotationSuffix) + return "$androidTestTaskPrefix$taskInfix$androidTestTaskSuffix" +} + +val requestedAndroidTestAnnotation = providers.gradleProperty("bitkitAndroidTestAnnotation") + .orNull + ?.trim() + ?.takeIf { it.isNotEmpty() } + ?.also { + require('.' !in it) { + "Use a simple Android test annotation name, e.g. 'DeviceUiIntegrationAndroidTest'." + } + require(it in androidTestAnnotationNames) { + "Unsupported bitkitAndroidTestAnnotation '$it'. Supported annotations: " + + androidTestAnnotationNames.joinToString(", ") + } } - requestedTaskNames.any { it == "connectedDevDebugDeviceUiIntegrationAndroidTest" } -> { - deviceUiIntegrationTestAnnotation +val bitkitAndroidTestAnnotationName = requestedAndroidTestAnnotation + ?: requestedTaskNames.firstNotNullOfOrNull { taskName -> + androidTestAnnotationNames.firstOrNull { androidTestTaskName(it) == taskName } } - requestedTaskNames.any { it == "connectedDevDebugDeviceIntegrationAndroidTest" } -> deviceIntegrationTestAnnotation - bitkitAndroidTestSuite == "compose" -> composeUiTestAnnotation - bitkitAndroidTestSuite == "core-service" -> coreServiceIntegrationTestAnnotation - bitkitAndroidTestSuite == "device-storage" -> deviceStorageIntegrationTestAnnotation - bitkitAndroidTestSuite == "device-ui" -> deviceUiIntegrationTestAnnotation - bitkitAndroidTestSuite == "integration" -> deviceIntegrationTestAnnotation - bitkitAndroidTestSuite == null -> null - else -> error("Unsupported bitkitAndroidTestSuite '$bitkitAndroidTestSuite'") +val bitkitAndroidTestAnnotation = bitkitAndroidTestAnnotationName?.let { + "$androidTestAnnotationPackage.$it" } android { @@ -397,34 +412,12 @@ tasks.withType().configureEach { jvmArgs("-XX:+EnableDynamicAgentLoading") } -tasks.register("connectedDevDebugComposeAndroidTest") { - group = "verification" - description = "Runs devDebug Android tests annotated as Compose UI tests." - dependsOn("connectedDevDebugAndroidTest") -} - -tasks.register("connectedDevDebugDeviceIntegrationAndroidTest") { - group = "verification" - description = "Runs devDebug Android tests annotated as device integration tests." - dependsOn("connectedDevDebugAndroidTest") -} - -tasks.register("connectedDevDebugCoreServiceIntegrationAndroidTest") { - group = "verification" - description = "Runs devDebug Android tests annotated as core service integration tests." - dependsOn("connectedDevDebugAndroidTest") -} - -tasks.register("connectedDevDebugDeviceStorageIntegrationAndroidTest") { - group = "verification" - description = "Runs devDebug Android tests annotated as device storage integration tests." - dependsOn("connectedDevDebugAndroidTest") -} - -tasks.register("connectedDevDebugDeviceUiIntegrationAndroidTest") { - group = "verification" - description = "Runs devDebug Android tests annotated as device UI integration tests." - dependsOn("connectedDevDebugAndroidTest") +androidTestAnnotationNames.forEach { annotationName -> + tasks.register(androidTestTaskName(annotationName)) { + group = "verification" + description = "Runs devDebug Android tests annotated with '$annotationName'." + dependsOn("connectedDevDebugAndroidTest") + } } // endregion diff --git a/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt b/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt index 0634954d39..115ec9bedf 100644 --- a/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt +++ b/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt @@ -14,16 +14,16 @@ import org.junit.runner.RunWith import to.bitkit.data.AppDb import to.bitkit.data.entities.ConfigEntity import to.bitkit.test.BaseAndroidTest -import to.bitkit.test.annotations.DeviceIntegrationTest -import to.bitkit.test.annotations.DeviceStorageIntegrationTest +import to.bitkit.test.annotations.DeviceIntegrationAndroidTest +import to.bitkit.test.annotations.DeviceStorageIntegrationAndroidTest import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertNull import kotlin.test.assertTrue @RunWith(AndroidJUnit4::class) -@DeviceIntegrationTest -@DeviceStorageIntegrationTest +@DeviceIntegrationAndroidTest +@DeviceStorageIntegrationAndroidTest class KeychainTest : BaseAndroidTest() { private val appContext by lazy { ApplicationProvider.getApplicationContext() } diff --git a/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt b/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt index 00bff76860..791cb5abe4 100644 --- a/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt +++ b/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt @@ -15,8 +15,8 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import to.bitkit.env.Env -import to.bitkit.test.annotations.CoreServiceIntegrationTest -import to.bitkit.test.annotations.DeviceIntegrationTest +import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest +import to.bitkit.test.annotations.DeviceIntegrationAndroidTest import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertNotEquals @@ -24,8 +24,8 @@ import kotlin.test.assertNotNull import kotlin.test.assertTrue @HiltAndroidTest -@DeviceIntegrationTest -@CoreServiceIntegrationTest +@DeviceIntegrationAndroidTest +@CoreServiceIntegrationAndroidTest class BlocktankTest { @get:Rule var hiltRule = HiltAndroidRule(this) diff --git a/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt b/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt index dd0e891df9..899ee3bcd5 100644 --- a/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt @@ -8,15 +8,15 @@ import org.junit.Test import org.junit.runner.RunWith import org.lightningdevkit.ldknode.Network import to.bitkit.models.toDerivationPath -import to.bitkit.test.annotations.CoreServiceIntegrationTest -import to.bitkit.test.annotations.DeviceIntegrationTest +import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest +import to.bitkit.test.annotations.DeviceIntegrationAndroidTest import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertTrue @RunWith(AndroidJUnit4::class) -@DeviceIntegrationTest -@CoreServiceIntegrationTest +@DeviceIntegrationAndroidTest +@CoreServiceIntegrationAndroidTest class OnchainServiceTests { private lateinit var onchainService: OnchainService diff --git a/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt b/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt index fae997f559..be8c0163e3 100644 --- a/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt +++ b/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt @@ -18,8 +18,8 @@ import to.bitkit.data.CacheStore import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo -import to.bitkit.test.annotations.CoreServiceIntegrationTest -import to.bitkit.test.annotations.DeviceIntegrationTest +import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest +import to.bitkit.test.annotations.DeviceIntegrationAndroidTest import to.bitkit.utils.LdkError import javax.inject.Inject import kotlin.test.assertEquals @@ -29,8 +29,8 @@ import kotlin.test.assertTrue @HiltAndroidTest @RunWith(AndroidJUnit4::class) -@DeviceIntegrationTest -@CoreServiceIntegrationTest +@DeviceIntegrationAndroidTest +@CoreServiceIntegrationAndroidTest class RoutingFeeEstimationTest { companion object { diff --git a/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt b/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt index 6206efd1e2..dab9a913f4 100644 --- a/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt @@ -15,8 +15,8 @@ import org.junit.runner.RunWith import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo -import to.bitkit.test.annotations.CoreServiceIntegrationTest -import to.bitkit.test.annotations.DeviceIntegrationTest +import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest +import to.bitkit.test.annotations.DeviceIntegrationAndroidTest import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -25,8 +25,8 @@ import kotlin.test.assertTrue @HiltAndroidTest @RunWith(AndroidJUnit4::class) -@DeviceIntegrationTest -@CoreServiceIntegrationTest +@DeviceIntegrationAndroidTest +@CoreServiceIntegrationAndroidTest class TxBumpingTests { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt b/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt index 2b9d9cc0fc..6096187215 100644 --- a/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt @@ -16,8 +16,8 @@ import org.lightningdevkit.ldknode.CoinSelectionAlgorithm import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo -import to.bitkit.test.annotations.CoreServiceIntegrationTest -import to.bitkit.test.annotations.DeviceIntegrationTest +import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest +import to.bitkit.test.annotations.DeviceIntegrationAndroidTest import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -27,8 +27,8 @@ import kotlin.test.fail @HiltAndroidTest @RunWith(AndroidJUnit4::class) -@DeviceIntegrationTest -@CoreServiceIntegrationTest +@DeviceIntegrationAndroidTest +@CoreServiceIntegrationAndroidTest class UtxoSelectionTests { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiAndroidTest.kt similarity index 78% rename from app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiTest.kt rename to app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiAndroidTest.kt index 0b7581810e..2c4cb3b518 100644 --- a/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiTest.kt +++ b/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiAndroidTest.kt @@ -2,4 +2,4 @@ package to.bitkit.test.annotations @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class ComposeUiTest +annotation class ComposeUiAndroidTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationAndroidTest.kt similarity index 72% rename from app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationTest.kt rename to app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationAndroidTest.kt index 2a99d5c581..243f87b694 100644 --- a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationTest.kt +++ b/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationAndroidTest.kt @@ -2,4 +2,4 @@ package to.bitkit.test.annotations @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class DeviceStorageIntegrationTest +annotation class CoreServiceIntegrationAndroidTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationAndroidTest.kt similarity index 74% rename from app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationTest.kt rename to app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationAndroidTest.kt index f36be5a1cc..d613f56d83 100644 --- a/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationTest.kt +++ b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationAndroidTest.kt @@ -2,4 +2,4 @@ package to.bitkit.test.annotations @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class CoreServiceIntegrationTest +annotation class DeviceIntegrationAndroidTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationAndroidTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationAndroidTest.kt new file mode 100644 index 0000000000..5b595be845 --- /dev/null +++ b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationAndroidTest.kt @@ -0,0 +1,5 @@ +package to.bitkit.test.annotations + +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +annotation class DeviceStorageIntegrationAndroidTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationAndroidTest.kt similarity index 73% rename from app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationTest.kt rename to app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationAndroidTest.kt index d3fe905adf..b08544f7f6 100644 --- a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationTest.kt +++ b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationAndroidTest.kt @@ -2,4 +2,4 @@ package to.bitkit.test.annotations @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class DeviceIntegrationTest +annotation class DeviceUiIntegrationAndroidTest diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationTest.kt deleted file mode 100644 index de2a9f00c7..0000000000 --- a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationTest.kt +++ /dev/null @@ -1,5 +0,0 @@ -package to.bitkit.test.annotations - -@Retention(AnnotationRetention.RUNTIME) -@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class DeviceUiIntegrationTest diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt index cfae877313..d05c15a471 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt @@ -7,12 +7,12 @@ import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test import to.bitkit.models.NodeLifecycleState -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.viewmodels.SendMethod import to.bitkit.viewmodels.SendUiState import to.bitkit.viewmodels.previewAmountInputViewModel -@ComposeUiTest +@ComposeUiAndroidTest class SendAmountContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt index b6f2d5247f..ef7a1f8ee3 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class BlockCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt index 4465a79db4..5c5392dd58 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class FactsCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt index d222a1443c..d08e3a127b 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class FactsPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt index 7f6bf4e2c3..295c7b355c 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class HeadlineCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt index 5b537d1e29..793e820d98 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt @@ -9,10 +9,10 @@ import org.junit.Rule import org.junit.Test import to.bitkit.models.widget.ArticleModel import to.bitkit.models.widget.HeadlinePreferences -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class HeadlinesEditContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt index 8b2f83c4ff..7cf40ffe46 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt @@ -7,10 +7,10 @@ import org.junit.Rule import org.junit.Test import to.bitkit.models.widget.ArticleModel import to.bitkit.models.widget.HeadlinePreferences -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class HeadlinesPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt index a6be686808..daa3f335ad 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt @@ -9,11 +9,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class WeatherCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt index 87ea27ea09..01d3b4a800 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt @@ -11,11 +11,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class WeatherEditScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt index 2d9f4832ff..5e0b098d63 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt @@ -9,11 +9,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class WeatherPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt index 7d5c6137bd..fbd34cb135 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class BackupIntroScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt index 28047ed00f..2102c98535 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt @@ -9,11 +9,11 @@ import dagger.hilt.android.testing.HiltAndroidTest import org.junit.Before import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface @HiltAndroidTest -@ComposeUiTest +@ComposeUiAndroidTest class QuickPaySettingsScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt index a6ca7db6e5..86738542c9 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt @@ -8,10 +8,10 @@ import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performTextInput import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiTest +@ComposeUiAndroidTest class ReportIssueContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt b/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt index af4e931d4e..1cef8088ca 100644 --- a/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt @@ -20,7 +20,7 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest import to.bitkit.ui.sheets.BoostTransactionContent import to.bitkit.ui.sheets.BoostTransactionTestTags import to.bitkit.ui.sheets.BoostTransactionUiState @@ -29,7 +29,7 @@ import to.bitkit.ui.theme.AppThemeSurface @HiltAndroidTest @RunWith(AndroidJUnit4::class) -@ComposeUiTest +@ComposeUiAndroidTest class BoostTransactionContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt b/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt index 065a1b99b4..c1ffb08623 100644 --- a/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt @@ -11,10 +11,10 @@ import org.junit.Test import to.bitkit.models.NewTransactionSheetDetails import to.bitkit.models.NewTransactionSheetDirection import to.bitkit.models.NewTransactionSheetType -import to.bitkit.test.annotations.ComposeUiTest +import to.bitkit.test.annotations.ComposeUiAndroidTest @HiltAndroidTest -@ComposeUiTest +@ComposeUiAndroidTest class NewTransactionSheetViewTest { @get:Rule From 7e60cf6339feb8036c2cc8388ebdde3b6ac2676e Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Sat, 16 May 2026 19:40:20 +0200 Subject: [PATCH 5/9] refactor: shorten test markers --- .github/workflows/ui-tests.yml | 4 ++-- app/build.gradle.kts | 9 +++------ .../java/to/bitkit/data/keychain/KeychainTest.kt | 8 ++++---- .../androidTest/java/to/bitkit/services/BlocktankTest.kt | 8 ++++---- .../java/to/bitkit/services/OnchainServiceTests.kt | 8 ++++---- .../java/to/bitkit/services/RoutingFeeEstimationTest.kt | 8 ++++---- .../java/to/bitkit/services/TxBumpingTests.kt | 8 ++++---- .../java/to/bitkit/services/UtxoSelectionTests.kt | 8 ++++---- .../{ComposeUiAndroidTest.kt => ComposeUi.kt} | 2 +- ...tegrationAndroidTest.kt => CoreServiceIntegration.kt} | 2 +- ...eUiIntegrationAndroidTest.kt => DeviceIntegration.kt} | 2 +- ...grationAndroidTest.kt => DeviceStorageIntegration.kt} | 2 +- .../annotations/DeviceStorageIntegrationAndroidTest.kt | 5 ----- .../ui/screens/wallets/send/SendAmountContentTest.kt | 4 ++-- .../to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt | 4 ++-- .../to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt | 4 ++-- .../ui/screens/widgets/facts/FactsPreviewScreenTest.kt | 4 ++-- .../ui/screens/widgets/headlines/HeadlineCardTest.kt | 4 ++-- .../widgets/headlines/HeadlinesEditContentTest.kt | 4 ++-- .../widgets/headlines/HeadlinesPreviewContentTest.kt | 4 ++-- .../bitkit/ui/screens/widgets/weather/WeatherCardTest.kt | 4 ++-- .../ui/screens/widgets/weather/WeatherEditScreenTest.kt | 4 ++-- .../screens/widgets/weather/WeatherPreviewScreenTest.kt | 4 ++-- .../bitkit/ui/settings/backups/BackupIntroScreenTest.kt | 4 ++-- .../ui/settings/quickPay/QuickPaySettingsScreenTest.kt | 4 ++-- .../bitkit/ui/settings/support/ReportIssueScreenTest.kt | 4 ++-- .../to/bitkit/ui/sheets/BoostTransactionSheetTest.kt | 4 ++-- .../to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt | 4 ++-- 28 files changed, 63 insertions(+), 71 deletions(-) rename app/src/androidTest/java/to/bitkit/test/annotations/{ComposeUiAndroidTest.kt => ComposeUi.kt} (78%) rename app/src/androidTest/java/to/bitkit/test/annotations/{DeviceIntegrationAndroidTest.kt => CoreServiceIntegration.kt} (74%) rename app/src/androidTest/java/to/bitkit/test/annotations/{DeviceUiIntegrationAndroidTest.kt => DeviceIntegration.kt} (73%) rename app/src/androidTest/java/to/bitkit/test/annotations/{CoreServiceIntegrationAndroidTest.kt => DeviceStorageIntegration.kt} (72%) delete mode 100644 app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationAndroidTest.kt diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 7ef233578e..30d251c287 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -120,8 +120,8 @@ jobs: IFS=',' read -ra requested_suites <<< "$suites" for suite in "${requested_suites[@]}"; do - if [[ "$suite" == *.* || ! "$suite" =~ ^[A-Z][A-Za-z0-9]*AndroidTest$ ]]; then - echo "::error::Invalid Android test annotation '$suite'. Use all or comma-separated simple annotation names such as DeviceUiIntegrationAndroidTest." + if [[ "$suite" == *.* || ! "$suite" =~ ^[A-Z][A-Za-z0-9]*$ ]]; then + echo "::error::Invalid Android test annotation '$suite'. Use all or comma-separated simple annotation names such as ComposeUi." exit 1 fi diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 369306f0bd..a39a954096 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -51,7 +51,6 @@ val e2eHomegateUrlEnv = System.getenv("E2E_HOMEGATE_URL") ?: "http://127.0.0.1:6 val trezorBridgeEnv = System.getenv("TREZOR_BRIDGE")?.toBoolean()?.toString() ?: "false" val trezorBridgeUrlEnv = System.getenv("TREZOR_BRIDGE_URL") ?: "http://10.0.2.2:21325" val androidTestAnnotationPackage = "to.bitkit.test.annotations" -val androidTestAnnotationSuffix = "AndroidTest" val androidTestTaskPrefix = "connectedDevDebug" val androidTestTaskSuffix = "AndroidTest" val androidTestAnnotationNames = file("src/androidTest/java/to/bitkit/test/annotations") @@ -59,8 +58,7 @@ val androidTestAnnotationNames = file("src/androidTest/java/to/bitkit/test/annot ?.mapNotNull { file -> file.nameWithoutExtension.takeIf { file.isFile && - file.extension == "kt" && - it.endsWith(androidTestAnnotationSuffix) + file.extension == "kt" } } ?.sorted() @@ -68,8 +66,7 @@ val androidTestAnnotationNames = file("src/androidTest/java/to/bitkit/test/annot val requestedTaskNames = gradle.startParameter.taskNames.map { it.substringAfterLast(":") } fun androidTestTaskName(annotationName: String): String { - val taskInfix = annotationName.removeSuffix(androidTestAnnotationSuffix) - return "$androidTestTaskPrefix$taskInfix$androidTestTaskSuffix" + return "$androidTestTaskPrefix$annotationName$androidTestTaskSuffix" } val requestedAndroidTestAnnotation = providers.gradleProperty("bitkitAndroidTestAnnotation") @@ -78,7 +75,7 @@ val requestedAndroidTestAnnotation = providers.gradleProperty("bitkitAndroidTest ?.takeIf { it.isNotEmpty() } ?.also { require('.' !in it) { - "Use a simple Android test annotation name, e.g. 'DeviceUiIntegrationAndroidTest'." + "Use a simple Android test annotation name, e.g. 'ComposeUi'." } require(it in androidTestAnnotationNames) { "Unsupported bitkitAndroidTestAnnotation '$it'. Supported annotations: " + diff --git a/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt b/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt index 115ec9bedf..d627c64590 100644 --- a/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt +++ b/app/src/androidTest/java/to/bitkit/data/keychain/KeychainTest.kt @@ -14,16 +14,16 @@ import org.junit.runner.RunWith import to.bitkit.data.AppDb import to.bitkit.data.entities.ConfigEntity import to.bitkit.test.BaseAndroidTest -import to.bitkit.test.annotations.DeviceIntegrationAndroidTest -import to.bitkit.test.annotations.DeviceStorageIntegrationAndroidTest +import to.bitkit.test.annotations.DeviceIntegration +import to.bitkit.test.annotations.DeviceStorageIntegration import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertNull import kotlin.test.assertTrue @RunWith(AndroidJUnit4::class) -@DeviceIntegrationAndroidTest -@DeviceStorageIntegrationAndroidTest +@DeviceIntegration +@DeviceStorageIntegration class KeychainTest : BaseAndroidTest() { private val appContext by lazy { ApplicationProvider.getApplicationContext() } diff --git a/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt b/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt index 791cb5abe4..2448743149 100644 --- a/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt +++ b/app/src/androidTest/java/to/bitkit/services/BlocktankTest.kt @@ -15,8 +15,8 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import to.bitkit.env.Env -import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest -import to.bitkit.test.annotations.DeviceIntegrationAndroidTest +import to.bitkit.test.annotations.CoreServiceIntegration +import to.bitkit.test.annotations.DeviceIntegration import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertNotEquals @@ -24,8 +24,8 @@ import kotlin.test.assertNotNull import kotlin.test.assertTrue @HiltAndroidTest -@DeviceIntegrationAndroidTest -@CoreServiceIntegrationAndroidTest +@DeviceIntegration +@CoreServiceIntegration class BlocktankTest { @get:Rule var hiltRule = HiltAndroidRule(this) diff --git a/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt b/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt index 899ee3bcd5..aaabf6b96d 100644 --- a/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/OnchainServiceTests.kt @@ -8,15 +8,15 @@ import org.junit.Test import org.junit.runner.RunWith import org.lightningdevkit.ldknode.Network import to.bitkit.models.toDerivationPath -import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest -import to.bitkit.test.annotations.DeviceIntegrationAndroidTest +import to.bitkit.test.annotations.CoreServiceIntegration +import to.bitkit.test.annotations.DeviceIntegration import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertTrue @RunWith(AndroidJUnit4::class) -@DeviceIntegrationAndroidTest -@CoreServiceIntegrationAndroidTest +@DeviceIntegration +@CoreServiceIntegration class OnchainServiceTests { private lateinit var onchainService: OnchainService diff --git a/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt b/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt index be8c0163e3..7c2a6fc1e2 100644 --- a/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt +++ b/app/src/androidTest/java/to/bitkit/services/RoutingFeeEstimationTest.kt @@ -18,8 +18,8 @@ import to.bitkit.data.CacheStore import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo -import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest -import to.bitkit.test.annotations.DeviceIntegrationAndroidTest +import to.bitkit.test.annotations.CoreServiceIntegration +import to.bitkit.test.annotations.DeviceIntegration import to.bitkit.utils.LdkError import javax.inject.Inject import kotlin.test.assertEquals @@ -29,8 +29,8 @@ import kotlin.test.assertTrue @HiltAndroidTest @RunWith(AndroidJUnit4::class) -@DeviceIntegrationAndroidTest -@CoreServiceIntegrationAndroidTest +@DeviceIntegration +@CoreServiceIntegration class RoutingFeeEstimationTest { companion object { diff --git a/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt b/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt index dab9a913f4..ddec667793 100644 --- a/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/TxBumpingTests.kt @@ -15,8 +15,8 @@ import org.junit.runner.RunWith import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo -import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest -import to.bitkit.test.annotations.DeviceIntegrationAndroidTest +import to.bitkit.test.annotations.CoreServiceIntegration +import to.bitkit.test.annotations.DeviceIntegration import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -25,8 +25,8 @@ import kotlin.test.assertTrue @HiltAndroidTest @RunWith(AndroidJUnit4::class) -@DeviceIntegrationAndroidTest -@CoreServiceIntegrationAndroidTest +@DeviceIntegration +@CoreServiceIntegration class TxBumpingTests { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt b/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt index 6096187215..b93fd0da34 100644 --- a/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt +++ b/app/src/androidTest/java/to/bitkit/services/UtxoSelectionTests.kt @@ -16,8 +16,8 @@ import org.lightningdevkit.ldknode.CoinSelectionAlgorithm import to.bitkit.data.keychain.Keychain import to.bitkit.env.Env import to.bitkit.repositories.WalletRepo -import to.bitkit.test.annotations.CoreServiceIntegrationAndroidTest -import to.bitkit.test.annotations.DeviceIntegrationAndroidTest +import to.bitkit.test.annotations.CoreServiceIntegration +import to.bitkit.test.annotations.DeviceIntegration import javax.inject.Inject import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -27,8 +27,8 @@ import kotlin.test.fail @HiltAndroidTest @RunWith(AndroidJUnit4::class) -@DeviceIntegrationAndroidTest -@CoreServiceIntegrationAndroidTest +@DeviceIntegration +@CoreServiceIntegration class UtxoSelectionTests { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiAndroidTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUi.kt similarity index 78% rename from app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiAndroidTest.kt rename to app/src/androidTest/java/to/bitkit/test/annotations/ComposeUi.kt index 2c4cb3b518..002476defe 100644 --- a/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUiAndroidTest.kt +++ b/app/src/androidTest/java/to/bitkit/test/annotations/ComposeUi.kt @@ -2,4 +2,4 @@ package to.bitkit.test.annotations @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class ComposeUiAndroidTest +annotation class ComposeUi diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationAndroidTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegration.kt similarity index 74% rename from app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationAndroidTest.kt rename to app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegration.kt index d613f56d83..85955c7459 100644 --- a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegrationAndroidTest.kt +++ b/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegration.kt @@ -2,4 +2,4 @@ package to.bitkit.test.annotations @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class DeviceIntegrationAndroidTest +annotation class CoreServiceIntegration diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationAndroidTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegration.kt similarity index 73% rename from app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationAndroidTest.kt rename to app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegration.kt index b08544f7f6..7f1bc36653 100644 --- a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceUiIntegrationAndroidTest.kt +++ b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceIntegration.kt @@ -2,4 +2,4 @@ package to.bitkit.test.annotations @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class DeviceUiIntegrationAndroidTest +annotation class DeviceIntegration diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationAndroidTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegration.kt similarity index 72% rename from app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationAndroidTest.kt rename to app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegration.kt index 243f87b694..f8e6412a4e 100644 --- a/app/src/androidTest/java/to/bitkit/test/annotations/CoreServiceIntegrationAndroidTest.kt +++ b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegration.kt @@ -2,4 +2,4 @@ package to.bitkit.test.annotations @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class CoreServiceIntegrationAndroidTest +annotation class DeviceStorageIntegration diff --git a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationAndroidTest.kt b/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationAndroidTest.kt deleted file mode 100644 index 5b595be845..0000000000 --- a/app/src/androidTest/java/to/bitkit/test/annotations/DeviceStorageIntegrationAndroidTest.kt +++ /dev/null @@ -1,5 +0,0 @@ -package to.bitkit.test.annotations - -@Retention(AnnotationRetention.RUNTIME) -@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) -annotation class DeviceStorageIntegrationAndroidTest diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt index d05c15a471..6be28a235b 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/wallets/send/SendAmountContentTest.kt @@ -7,12 +7,12 @@ import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test import to.bitkit.models.NodeLifecycleState -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.viewmodels.SendMethod import to.bitkit.viewmodels.SendUiState import to.bitkit.viewmodels.previewAmountInputViewModel -@ComposeUiAndroidTest +@ComposeUi class SendAmountContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt index ef7a1f8ee3..876aef7a45 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class BlockCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt index 5c5392dd58..f1e941085e 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsCardTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class FactsCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt index d08e3a127b..ec9dd7b5bc 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/facts/FactsPreviewScreenTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class FactsPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt index 295c7b355c..e0a8ebe5b6 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlineCardTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class HeadlineCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt index 793e820d98..84e7de8a30 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesEditContentTest.kt @@ -9,10 +9,10 @@ import org.junit.Rule import org.junit.Test import to.bitkit.models.widget.ArticleModel import to.bitkit.models.widget.HeadlinePreferences -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class HeadlinesEditContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt index 7cf40ffe46..3566df1a31 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/headlines/HeadlinesPreviewContentTest.kt @@ -7,10 +7,10 @@ import org.junit.Rule import org.junit.Test import to.bitkit.models.widget.ArticleModel import to.bitkit.models.widget.HeadlinePreferences -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class HeadlinesPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt index daa3f335ad..d3299d0112 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherCardTest.kt @@ -9,11 +9,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class WeatherCardTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt index 01d3b4a800..88efd88952 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherEditScreenTest.kt @@ -11,11 +11,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class WeatherEditScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt index 5e0b098d63..5c86ad80f2 100644 --- a/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/screens/widgets/weather/WeatherPreviewScreenTest.kt @@ -9,11 +9,11 @@ import to.bitkit.R import to.bitkit.data.dto.FeeCondition import to.bitkit.models.widget.WeatherDataOption import to.bitkit.models.widget.WeatherPreferences -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.screens.widgets.blocks.WeatherModel import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class WeatherPreviewContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt index fbd34cb135..03a55f47c3 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/backups/BackupIntroScreenTest.kt @@ -5,10 +5,10 @@ import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performClick import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class BackupIntroScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt index 2102c98535..1a179f2b0e 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/quickPay/QuickPaySettingsScreenTest.kt @@ -9,11 +9,11 @@ import dagger.hilt.android.testing.HiltAndroidTest import org.junit.Before import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface @HiltAndroidTest -@ComposeUiAndroidTest +@ComposeUi class QuickPaySettingsScreenTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt b/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt index 86738542c9..1174c3d286 100644 --- a/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/settings/support/ReportIssueScreenTest.kt @@ -8,10 +8,10 @@ import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performTextInput import org.junit.Rule import org.junit.Test -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.theme.AppThemeSurface -@ComposeUiAndroidTest +@ComposeUi class ReportIssueContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt b/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt index 1cef8088ca..6e206dd710 100644 --- a/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/sheets/BoostTransactionSheetTest.kt @@ -20,7 +20,7 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi import to.bitkit.ui.sheets.BoostTransactionContent import to.bitkit.ui.sheets.BoostTransactionTestTags import to.bitkit.ui.sheets.BoostTransactionUiState @@ -29,7 +29,7 @@ import to.bitkit.ui.theme.AppThemeSurface @HiltAndroidTest @RunWith(AndroidJUnit4::class) -@ComposeUiAndroidTest +@ComposeUi class BoostTransactionContentTest { @get:Rule diff --git a/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt b/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt index c1ffb08623..796e9f28a9 100644 --- a/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt +++ b/app/src/androidTest/java/to/bitkit/ui/sheets/NewTransactionSheetViewTest.kt @@ -11,10 +11,10 @@ import org.junit.Test import to.bitkit.models.NewTransactionSheetDetails import to.bitkit.models.NewTransactionSheetDirection import to.bitkit.models.NewTransactionSheetType -import to.bitkit.test.annotations.ComposeUiAndroidTest +import to.bitkit.test.annotations.ComposeUi @HiltAndroidTest -@ComposeUiAndroidTest +@ComposeUi class NewTransactionSheetViewTest { @get:Rule From c70cce15ed9a9b674a510c888b276ffe2509b232 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Mon, 18 May 2026 17:22:23 +0200 Subject: [PATCH 6/9] fix: reject multiple test lanes --- app/build.gradle.kts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a39a954096..e9c5a8ac21 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -69,6 +69,17 @@ fun androidTestTaskName(annotationName: String): String { return "$androidTestTaskPrefix$annotationName$androidTestTaskSuffix" } +val requestedAndroidTestAnnotationTaskNames = requestedTaskNames.filter { taskName -> + androidTestAnnotationNames.any { androidTestTaskName(it) == taskName } +} +require(requestedAndroidTestAnnotationTaskNames.size <= 1) { + "Run only one generated Android test lane per Gradle invocation. Requested lanes: " + + requestedAndroidTestAnnotationTaskNames.joinToString(", ") +} +val requestedAndroidTestAnnotationTask = requestedAndroidTestAnnotationTaskNames.singleOrNull() +val requestedAndroidTestAnnotationTaskName = requestedAndroidTestAnnotationTask?.let { taskName -> + androidTestAnnotationNames.first { androidTestTaskName(it) == taskName } +} val requestedAndroidTestAnnotation = providers.gradleProperty("bitkitAndroidTestAnnotation") .orNull ?.trim() @@ -82,10 +93,15 @@ val requestedAndroidTestAnnotation = providers.gradleProperty("bitkitAndroidTest androidTestAnnotationNames.joinToString(", ") } } -val bitkitAndroidTestAnnotationName = requestedAndroidTestAnnotation - ?: requestedTaskNames.firstNotNullOfOrNull { taskName -> - androidTestAnnotationNames.firstOrNull { androidTestTaskName(it) == taskName } +requestedAndroidTestAnnotationTaskName?.let { annotationName -> + requestedAndroidTestAnnotation?.let { + require(it == annotationName) { + "Do not combine bitkitAndroidTestAnnotation '$it' with generated lane '$annotationName'." + } } +} +val bitkitAndroidTestAnnotationName = requestedAndroidTestAnnotation + ?: requestedAndroidTestAnnotationTaskName val bitkitAndroidTestAnnotation = bitkitAndroidTestAnnotationName?.let { "$androidTestAnnotationPackage.$it" } From b354f3a1ddafc13f518fdaa948c4b2499ef55951 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Mon, 18 May 2026 17:39:37 +0200 Subject: [PATCH 7/9] ci: move ui test runner script --- .github/scripts/run-ui-tests.sh | 31 +++++++++++++++++++++++++++++++ .github/workflows/ui-tests.yml | 32 +------------------------------- 2 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 .github/scripts/run-ui-tests.sh diff --git a/.github/scripts/run-ui-tests.sh b/.github/scripts/run-ui-tests.sh new file mode 100644 index 0000000000..d24a135fc6 --- /dev/null +++ b/.github/scripts/run-ui-tests.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -euo pipefail + +adb wait-for-device +echo "Waiting for boot to complete..." +adb shell 'while [ -z "$(getprop sys.boot_completed)" ]; do sleep 1; done' +sleep 10 + +echo "Emulator ABI:" +adb shell getprop ro.product.cpu.abi + +./gradlew installDevDebug + +suites="${ANDROID_TEST_SUITES:-all}" +suites="$(echo "$suites" | tr -d '[:space:]')" + +if [[ -z "$suites" || "$suites" == "all" ]]; then + ./gradlew connectedDevDebugAndroidTest + exit 0 +fi + +IFS=',' read -ra requested_suites <<< "$suites" +for suite in "${requested_suites[@]}"; do + if [[ "$suite" == *.* || ! "$suite" =~ ^[A-Z][A-Za-z0-9]*$ ]]; then + echo "::error::Invalid Android test annotation '$suite'. Use all or comma-separated simple annotation names such as ComposeUi." + exit 1 + fi + + ./gradlew connectedDevDebugAndroidTest -PbitkitAndroidTestAnnotation="$suite" +done diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 30d251c287..c6da4ed2ea 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -96,37 +96,7 @@ jobs: force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true - script: | - # Wait for emulator to be fully ready - adb wait-for-device - echo "Waiting for boot to complete..." - adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done' - sleep 10 - - # Verify emulator ABI matches app - echo "Emulator ABI:" - adb shell getprop ro.product.cpu.abi - - # Install and run tests - ./gradlew installDevDebug - - suites="${ANDROID_TEST_SUITES:-all}" - suites="$(echo "$suites" | tr -d '[:space:]')" - - if [[ -z "$suites" || "$suites" == "all" ]]; then - ./gradlew connectedDevDebugAndroidTest - exit 0 - fi - - IFS=',' read -ra requested_suites <<< "$suites" - for suite in "${requested_suites[@]}"; do - if [[ "$suite" == *.* || ! "$suite" =~ ^[A-Z][A-Za-z0-9]*$ ]]; then - echo "::error::Invalid Android test annotation '$suite'. Use all or comma-separated simple annotation names such as ComposeUi." - exit 1 - fi - - ./gradlew connectedDevDebugAndroidTest -PbitkitAndroidTestAnnotation="$suite" - done + script: bash .github/scripts/run-ui-tests.sh - name: Upload UI test report if: always() From 0bafb284f6c580722a92d64577e6a2b99acc26ee Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Mon, 18 May 2026 17:44:14 +0200 Subject: [PATCH 8/9] fix: reject abbreviated test lanes --- app/build.gradle.kts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e9c5a8ac21..ea5c56824f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -53,6 +53,7 @@ val trezorBridgeUrlEnv = System.getenv("TREZOR_BRIDGE_URL") ?: "http://10.0.2.2: val androidTestAnnotationPackage = "to.bitkit.test.annotations" val androidTestTaskPrefix = "connectedDevDebug" val androidTestTaskSuffix = "AndroidTest" +val baseAndroidTestTaskName = "$androidTestTaskPrefix$androidTestTaskSuffix" val androidTestAnnotationNames = file("src/androidTest/java/to/bitkit/test/annotations") .listFiles() ?.mapNotNull { file -> @@ -69,8 +70,34 @@ fun androidTestTaskName(annotationName: String): String { return "$androidTestTaskPrefix$annotationName$androidTestTaskSuffix" } +fun isTaskNameAbbreviation(taskName: String, fullTaskName: String): Boolean { + if (taskName.isEmpty() || taskName == fullTaskName) return false + return fullTaskName.startsWith(taskName) || + taskName.any { it.isUpperCase() } && + taskName.isSubsequenceOf(fullTaskName) +} + +fun String.isSubsequenceOf(value: String): Boolean { + var searchIndex = 0 + for (char in this) { + searchIndex = value.indexOf(char, startIndex = searchIndex) + if (searchIndex == -1) return false + searchIndex++ + } + return true +} + +val androidTestTaskNames = androidTestAnnotationNames.map { androidTestTaskName(it) } +val abbreviatedAndroidTestTaskNames = requestedTaskNames.filter { taskName -> + taskName != baseAndroidTestTaskName && + androidTestTaskNames.any { isTaskNameAbbreviation(taskName, it) } +} +require(abbreviatedAndroidTestTaskNames.isEmpty()) { + "Use full generated Android test lane task names. Abbreviated lane tasks are unsupported: " + + abbreviatedAndroidTestTaskNames.joinToString(", ") +} val requestedAndroidTestAnnotationTaskNames = requestedTaskNames.filter { taskName -> - androidTestAnnotationNames.any { androidTestTaskName(it) == taskName } + taskName in androidTestTaskNames } require(requestedAndroidTestAnnotationTaskNames.size <= 1) { "Run only one generated Android test lane per Gradle invocation. Requested lanes: " + From 162e5ffa06ee7e9f67c642cd196e764df35149c4 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Tue, 19 May 2026 00:41:25 +0200 Subject: [PATCH 9/9] fix: reject mixed test lanes --- app/build.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ea5c56824f..4d30be0537 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -90,6 +90,7 @@ fun String.isSubsequenceOf(value: String): Boolean { val androidTestTaskNames = androidTestAnnotationNames.map { androidTestTaskName(it) } val abbreviatedAndroidTestTaskNames = requestedTaskNames.filter { taskName -> taskName != baseAndroidTestTaskName && + taskName !in androidTestTaskNames && androidTestTaskNames.any { isTaskNameAbbreviation(taskName, it) } } require(abbreviatedAndroidTestTaskNames.isEmpty()) { @@ -99,6 +100,10 @@ require(abbreviatedAndroidTestTaskNames.isEmpty()) { val requestedAndroidTestAnnotationTaskNames = requestedTaskNames.filter { taskName -> taskName in androidTestTaskNames } +require(baseAndroidTestTaskName !in requestedTaskNames || requestedAndroidTestAnnotationTaskNames.isEmpty()) { + "Do not combine '$baseAndroidTestTaskName' with generated Android test lane tasks. Requested lanes: " + + requestedAndroidTestAnnotationTaskNames.joinToString(", ") +} require(requestedAndroidTestAnnotationTaskNames.size <= 1) { "Run only one generated Android test lane per Gradle invocation. Requested lanes: " + requestedAndroidTestAnnotationTaskNames.joinToString(", ")