From 68e8215e504d9c8a3c5e39fbc843838a7c030703 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 15 Jul 2026 14:33:07 +0200 Subject: [PATCH] Updated on 2026-08-14 --- .../tangem/scenarios/TangemPayScenarios.kt | 13 ++ .../tangempay/TangemPayCardPagePageObject.kt | 10 + .../TangemPayDailyLimitPageObject.kt | 47 +++++ .../tangempay/TangemPayDailyLimitTest.kt | 197 ++++++++++++++++++ .../tangem/core/ui/test/TangemPayTestTags.kt | 14 ++ .../setup/TangemPayCardLimitSetupModel.kt | 2 + .../setup/TangemPayCardLimitSetupScreenV2.kt | 7 +- .../TangemPayCardLimitSetupSuccessScreenV2.kt | 3 + .../limit/setup/TangemPayCardLimitSetupUM.kt | 9 +- .../tangempay/ui/TangemPayDailyLimitBlock.kt | 7 +- 10 files changed, 302 insertions(+), 7 deletions(-) create mode 100644 app/src/androidTest/kotlin/com/tangem/screens/tangempay/TangemPayDailyLimitPageObject.kt create mode 100644 app/src/androidTest/kotlin/com/tangem/tests/tangempay/TangemPayDailyLimitTest.kt diff --git a/app/src/androidTest/kotlin/com/tangem/scenarios/TangemPayScenarios.kt b/app/src/androidTest/kotlin/com/tangem/scenarios/TangemPayScenarios.kt index 1bd697787f..6372090d66 100644 --- a/app/src/androidTest/kotlin/com/tangem/scenarios/TangemPayScenarios.kt +++ b/app/src/androidTest/kotlin/com/tangem/scenarios/TangemPayScenarios.kt @@ -34,6 +34,19 @@ fun BaseTestCase.openTangemPayCardPage() { } } +/** Opens the card page and taps 'Change' on the daily limit block to reach the limit setup screen. */ +fun BaseTestCase.openTangemPayDailyLimitSetup() { + openTangemPayCardPage() + step("Click on 'Change' daily limit button") { + awaitSuccess { onTangemPayCardPageScreen { dailyLimitChangeButton.assertIsDisplayed() } } + onTangemPayCardPageScreen { dailyLimitChangeButton.performClick() } + } + step("Assert daily limit setup screen is displayed") { + awaitSuccess { onTangemPayDailyLimitScreen { amountField.assertIsDisplayed() } } + onTangemPayDailyLimitScreen { setLimitsButton.assertIsDisplayed() } + } +} + /** From the card page, opens the 'Replace card' reissue bottom sheet via the 'More' menu. */ fun BaseTestCase.openReissueSheet() { step("Click on 'More' button") { diff --git a/app/src/androidTest/kotlin/com/tangem/screens/tangempay/TangemPayCardPagePageObject.kt b/app/src/androidTest/kotlin/com/tangem/screens/tangempay/TangemPayCardPagePageObject.kt index 48a207d282..c6e0716f11 100644 --- a/app/src/androidTest/kotlin/com/tangem/screens/tangempay/TangemPayCardPagePageObject.kt +++ b/app/src/androidTest/kotlin/com/tangem/screens/tangempay/TangemPayCardPagePageObject.kt @@ -89,6 +89,16 @@ class TangemPayCardPagePageObject(semanticsProvider: SemanticsNodeInteractionsPr hasTestTag(TangemPayTestTags.CARD_DETAILS_COPY_CVC) useUnmergedTree = true } + + val dailyLimitChangeButton: KNode = child { + hasTestTag(TangemPayTestTags.DAILY_LIMIT_CHANGE_BUTTON) + useUnmergedTree = true + } + + val dailyLimitValue: KNode = child { + hasTestTag(TangemPayTestTags.DAILY_LIMIT_CURRENT_VALUE) + useUnmergedTree = true + } } internal fun BaseTestCase.onTangemPayCardPageScreen(function: TangemPayCardPagePageObject.() -> Unit) = diff --git a/app/src/androidTest/kotlin/com/tangem/screens/tangempay/TangemPayDailyLimitPageObject.kt b/app/src/androidTest/kotlin/com/tangem/screens/tangempay/TangemPayDailyLimitPageObject.kt new file mode 100644 index 0000000000..3a7903ec48 --- /dev/null +++ b/app/src/androidTest/kotlin/com/tangem/screens/tangempay/TangemPayDailyLimitPageObject.kt @@ -0,0 +1,47 @@ +package com.tangem.screens.tangempay + +import androidx.compose.ui.test.SemanticsNodeInteractionsProvider +import com.tangem.common.BaseTestCase +import com.tangem.core.ui.test.SendScreenTestTags +import com.tangem.core.ui.test.TangemPayTestTags +import io.github.kakaocup.compose.node.element.ComposeScreen +import io.github.kakaocup.compose.node.element.ComposeScreen.Companion.onComposeScreen +import io.github.kakaocup.compose.node.element.KNode + +class TangemPayDailyLimitPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) : + ComposeScreen(semanticsProvider = semanticsProvider) { + + // AmountTextField tags its editable field with SendScreenTestTags.INPUT_TEXT_FIELD; it's the only one here. + val amountField: KNode = child { + hasTestTag(SendScreenTestTags.INPUT_TEXT_FIELD) + useUnmergedTree = true + } + + val hint: KNode = child { + hasTestTag(TangemPayTestTags.DAILY_LIMIT_HINT) + useUnmergedTree = true + } + + val setLimitsButton: KNode = child { + hasTestTag(TangemPayTestTags.DAILY_LIMIT_SET_BUTTON) + useUnmergedTree = true + } + + val successTitle: KNode = child { + hasTestTag(TangemPayTestTags.DAILY_LIMIT_SUCCESS_TITLE) + useUnmergedTree = true + } + + val doneButton: KNode = child { + hasTestTag(TangemPayTestTags.DAILY_LIMIT_DONE_BUTTON) + useUnmergedTree = true + } + + fun presetChip(rawValue: String): KNode = child { + hasTestTag(TangemPayTestTags.dailyLimitPresetChip(rawValue)) + useUnmergedTree = true + } +} + +internal fun BaseTestCase.onTangemPayDailyLimitScreen(function: TangemPayDailyLimitPageObject.() -> Unit) = + onComposeScreen(composeTestRule, function) \ No newline at end of file diff --git a/app/src/androidTest/kotlin/com/tangem/tests/tangempay/TangemPayDailyLimitTest.kt b/app/src/androidTest/kotlin/com/tangem/tests/tangempay/TangemPayDailyLimitTest.kt new file mode 100644 index 0000000000..cfab66c32c --- /dev/null +++ b/app/src/androidTest/kotlin/com/tangem/tests/tangempay/TangemPayDailyLimitTest.kt @@ -0,0 +1,197 @@ +package com.tangem.tests.tangempay + +import com.tangem.common.BaseTestCase +import com.tangem.common.constants.TestConstants.TANGEM_PAY_ELIGIBILITY_SCENARIO +import com.tangem.common.constants.TestConstants.WAIT_UNTIL_TIMEOUT_LONG +import com.tangem.common.extensions.assertTextContainsSafe +import com.tangem.common.extensions.clickWithAssertion +import com.tangem.common.utils.resetWireMockScenarioState +import com.tangem.common.utils.resetWireMockScenarios +import com.tangem.common.utils.setWireMockScenarioState +import com.tangem.core.res.R as CoreResR +import com.tangem.scenarios.openTangemPayDailyLimitSetup +import com.tangem.screens.onDialog +import com.tangem.screens.tangempay.onTangemPayCardPageScreen +import com.tangem.screens.tangempay.onTangemPayDailyLimitScreen +import dagger.hilt.android.testing.HiltAndroidTest +import io.github.kakaocup.kakao.common.utilities.getResourceString +import io.qameta.allure.kotlin.AllureId +import io.qameta.allure.kotlin.junit4.DisplayName +import org.junit.Test + +@HiltAndroidTest +class TangemPayDailyLimitTest : BaseTestCase() { + + private val dailyLimitScenario = "tangem_pay_daily_limit" + private val highLimitState = "HighLimit" + private val setErrorState = "SetError" + private val eligibilityState = "PaeraCustomer" + + @AllureId("9726") + @DisplayName("Tangem Pay: daily limit screen is displayed correctly") + @Test + fun dailyLimitScreenIsDisplayedCorrectlyTest() { + setupHooks( + additionalBeforeSection = { + resetWireMockScenarios() + setWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO, eligibilityState) + setWireMockScenarioState(dailyLimitScenario, highLimitState) + }, + additionalAfterSection = { + resetWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO) + resetWireMockScenarioState(dailyLimitScenario) + }, + ).run { + step("Open daily limit setup screen") { openTangemPayDailyLimitSetup() } + step("Assert amount field, hint and 'Set limits' button are displayed") { + onTangemPayDailyLimitScreen { + amountField.assertIsDisplayed() + hint.assertIsDisplayed() + setLimitsButton.assertIsDisplayed() + } + } + step("Assert quick value presets are displayed") { + onTangemPayDailyLimitScreen { + presetChip("1").assertIsDisplayed() + presetChip("5000").assertIsDisplayed() + presetChip("10000").assertIsDisplayed() + presetChip("25000").assertIsDisplayed() + } + } + } + } + + @AllureId("9724") + @DisplayName("Tangem Pay: selected quick value is applied to the amount field") + @Test + fun selectedQuickValueIsAppliedToAmountFieldTest() { + val presetValue = "5000" + + setupHooks( + additionalBeforeSection = { + resetWireMockScenarios() + setWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO, eligibilityState) + setWireMockScenarioState(dailyLimitScenario, highLimitState) + }, + additionalAfterSection = { + resetWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO) + resetWireMockScenarioState(dailyLimitScenario) + }, + ).run { + step("Open daily limit setup screen") { openTangemPayDailyLimitSetup() } + step("Click on '$presetValue' quick value preset") { + onTangemPayDailyLimitScreen { presetChip(presetValue).clickWithAssertion() } + } + step("Assert amount field contains '$presetValue'") { + onTangemPayDailyLimitScreen { amountField.assertTextContainsSafe(presetValue) } + } + } + } + + @AllureId("9725") + @DisplayName("Tangem Pay: 'Set limits' is disabled when the amount is above the limit") + @Test + fun setLimitsIsDisabledWhenAmountAboveLimitTest() { + val amountAboveLimit = "300000" + + setupHooks( + additionalBeforeSection = { + resetWireMockScenarios() + setWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO, eligibilityState) + setWireMockScenarioState(dailyLimitScenario, highLimitState) + }, + additionalAfterSection = { + resetWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO) + resetWireMockScenarioState(dailyLimitScenario) + }, + ).run { + step("Open daily limit setup screen") { openTangemPayDailyLimitSetup() } + step("Enter amount '$amountAboveLimit' above the limit") { + onTangemPayDailyLimitScreen { amountField.performTextReplacement(amountAboveLimit) } + } + step("Assert 'Set limits' button is not enabled") { + onTangemPayDailyLimitScreen { setLimitsButton.assertIsNotEnabled() } + } + } + } + + @AllureId("9739") + @DisplayName("Tangem Pay: successful daily limit setup") + @Test + fun successfulDailyLimitSetupTest() { + val newLimit = "5000" + val displayedLimit = "5,000" + + setupHooks( + additionalBeforeSection = { + resetWireMockScenarios() + setWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO, eligibilityState) + setWireMockScenarioState(dailyLimitScenario, highLimitState) + }, + additionalAfterSection = { + resetWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO) + resetWireMockScenarioState(dailyLimitScenario) + }, + ).run { + step("Open daily limit setup screen") { openTangemPayDailyLimitSetup() } + step("Enter amount '$newLimit'") { + onTangemPayDailyLimitScreen { amountField.performTextReplacement(newLimit) } + } + step("Click on 'Set limits' button") { + onTangemPayDailyLimitScreen { setLimitsButton.clickWithAssertion() } + } + step("Assert daily limit success screen is displayed") { + flakySafely(WAIT_UNTIL_TIMEOUT_LONG) { + onTangemPayDailyLimitScreen { successTitle.assertIsDisplayed() } + } + } + step("Click on 'Done' button") { + onTangemPayDailyLimitScreen { doneButton.clickWithAssertion() } + } + step("Assert daily limit value contains '$displayedLimit'") { + flakySafely(WAIT_UNTIL_TIMEOUT_LONG) { + onTangemPayCardPageScreen { + dailyLimitValue.assertTextContainsSafe(displayedLimit, substring = true) + } + } + } + } + } + + @AllureId("9727") + @DisplayName("Tangem Pay: error is shown when the limit change fails") + @Test + fun errorIsShownWhenLimitChangeFailsTest() { + val newLimit = "5000" + + setupHooks( + additionalBeforeSection = { + resetWireMockScenarios() + setWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO, eligibilityState) + setWireMockScenarioState(dailyLimitScenario, setErrorState) + }, + additionalAfterSection = { + resetWireMockScenarioState(TANGEM_PAY_ELIGIBILITY_SCENARIO) + resetWireMockScenarioState(dailyLimitScenario) + }, + ).run { + step("Open daily limit setup screen") { openTangemPayDailyLimitSetup() } + step("Enter amount '$newLimit'") { + onTangemPayDailyLimitScreen { amountField.performTextReplacement(newLimit) } + } + step("Click on 'Set limits' button") { + onTangemPayDailyLimitScreen { setLimitsButton.clickWithAssertion() } + } + step("Assert limit change error dialog is displayed") { + flakySafely(WAIT_UNTIL_TIMEOUT_LONG) { + onDialog { + title.assertTextContainsSafe(getResourceString(CoreResR.string.common_something_went_wrong)) + } + } + } + step("Click on 'OK' button") { + onDialog { okButton.clickWithAssertion() } + } + } + } +} \ No newline at end of file diff --git a/core/ui/src/main/java/com/tangem/core/ui/test/TangemPayTestTags.kt b/core/ui/src/main/java/com/tangem/core/ui/test/TangemPayTestTags.kt index bcd265fbb1..8b3f05e78c 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/test/TangemPayTestTags.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/test/TangemPayTestTags.kt @@ -51,4 +51,18 @@ object TangemPayTestTags { const val PIN_SUCCESS_TITLE = "TANGEM_PAY_PIN_SUCCESS_TITLE" const val PIN_SUCCESS_DESCRIPTION = "TANGEM_PAY_PIN_SUCCESS_DESCRIPTION" const val PIN_DONE_BUTTON = "TANGEM_PAY_PIN_DONE_BUTTON" + + // Daily limit block (card page) + const val DAILY_LIMIT_CHANGE_BUTTON = "TANGEM_PAY_DAILY_LIMIT_CHANGE_BUTTON" + const val DAILY_LIMIT_CURRENT_VALUE = "TANGEM_PAY_DAILY_LIMIT_CURRENT_VALUE" + + // Daily limit setup screen (amount field reuses SendScreenTestTags.INPUT_TEXT_FIELD from AmountTextField) + const val DAILY_LIMIT_HINT = "TANGEM_PAY_DAILY_LIMIT_HINT" + const val DAILY_LIMIT_SET_BUTTON = "TANGEM_PAY_DAILY_LIMIT_SET_BUTTON" + + // Daily limit success screen + const val DAILY_LIMIT_SUCCESS_TITLE = "TANGEM_PAY_DAILY_LIMIT_SUCCESS_TITLE" + const val DAILY_LIMIT_DONE_BUTTON = "TANGEM_PAY_DAILY_LIMIT_DONE_BUTTON" + + fun dailyLimitPresetChip(rawValue: String): String = "TANGEM_PAY_DAILY_LIMIT_PRESET_$rawValue" } \ No newline at end of file diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupModel.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupModel.kt index f87e0c155a..17cc2aae2d 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupModel.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupModel.kt @@ -14,6 +14,7 @@ import com.tangem.core.ui.format.bigdecimal.format import com.tangem.core.ui.format.bigdecimal.getJavaCurrencyByCode import com.tangem.core.ui.format.bigdecimal.optionalDecimals import com.tangem.core.ui.message.DialogMessage +import com.tangem.core.ui.test.TangemPayTestTags import com.tangem.domain.models.StatusSource import com.tangem.domain.models.account.PaymentAccountStatusValue import com.tangem.domain.models.account.findCardWithId @@ -201,6 +202,7 @@ internal class TangemPayCardLimitSetupModel @Inject constructor( val label = preset.format { fiat(currency.currencyCode, currency.symbol).optionalDecimals() } TangemPayCardLimitSetupUM.LimitPresetUM( label = label, + testTag = TangemPayTestTags.dailyLimitPresetChip(preset.stripTrailingZeros().toPlainString()), onClick = { onPresetClick(preset) }, ) }.toPersistentList() diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupScreenV2.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupScreenV2.kt index 24a093cf73..533318b058 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupScreenV2.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupScreenV2.kt @@ -15,6 +15,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.platform.testTag import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview @@ -30,6 +31,7 @@ import com.tangem.core.ui.extensions.resolveReference import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreviewRedesign +import com.tangem.core.ui.test.TangemPayTestTags import com.tangem.core.ui.utils.rememberDecimalFormat import com.tangem.features.tangempay.details.impl.R import kotlinx.collections.immutable.ImmutableList @@ -79,7 +81,8 @@ private fun Content(state: TangemPayCardLimitSetupUM, modifier: Modifier = Modif modifier = Modifier .fillMaxWidth() .padding(horizontal = TangemTheme.dimens2.x4) - .padding(top = TangemTheme.dimens2.x3), + .padding(top = TangemTheme.dimens2.x3) + .testTag(TangemPayTestTags.DAILY_LIMIT_SET_BUTTON), size = TangemButton.Size.X12, text = resourceReference(R.string.tangempay_daily_limit_set_button), onClick = state.onSubmitClick, @@ -99,6 +102,7 @@ private fun AmountBlock(state: TangemPayCardLimitSetupUM, modifier: Modifier = M verticalArrangement = Arrangement.spacedBy(TangemTheme.dimens2.x3), ) { Text( + modifier = Modifier.testTag(TangemPayTestTags.DAILY_LIMIT_HINT), text = state.subtitle.resolveReference(), style = TangemTheme.typography3.subheading.medium, color = TangemTheme.colors3.text.tertiary, @@ -158,6 +162,7 @@ private fun PresetChip(preset: TangemPayCardLimitSetupUM.LimitPresetUM, modifier .clip(RoundedCornerShape(14.dp)) .background(TangemTheme.colors3.bg.tertiary) .clickable(onClick = preset.onClick) + .testTag(preset.testTag) .padding(horizontal = TangemTheme.dimens2.x5, vertical = TangemTheme.dimens2.x1) .wrapContentHeight(), horizontalArrangement = Arrangement.Center, diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupSuccessScreenV2.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupSuccessScreenV2.kt index 81c924bbc5..0a171c38c6 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupSuccessScreenV2.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupSuccessScreenV2.kt @@ -5,6 +5,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.res.TangemThemePreviewRedesign +import com.tangem.core.ui.test.TangemPayTestTags import com.tangem.features.tangempay.details.impl.R import com.tangem.features.tangempay.ui.components.TangemPaySuccessScreenWrapper @@ -16,6 +17,8 @@ internal fun TangemPayCardLimitSetupSuccessScreenV2(onDoneClick: () -> Unit, mod subtitle = resourceReference(R.string.tangempay_card_page_daily_limit_success_description), buttonText = resourceReference(R.string.common_done), onButtonClick = onDoneClick, + titleTestTag = TangemPayTestTags.DAILY_LIMIT_SUCCESS_TITLE, + buttonTestTag = TangemPayTestTags.DAILY_LIMIT_DONE_BUTTON, ) } diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupUM.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupUM.kt index e77e83b186..141c4e5b6a 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupUM.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/limit/setup/TangemPayCardLimitSetupUM.kt @@ -28,6 +28,7 @@ internal data class TangemPayCardLimitSetupUM( @Immutable internal data class LimitPresetUM( val label: String, + val testTag: String, val onClick: () -> Unit, ) @@ -42,10 +43,10 @@ internal data class TangemPayCardLimitSetupUM( subtitle: TextReference = TextReference.Str("Set a limit from $0 to $50,000"), currencyCode: String = "$", presets: ImmutableList = persistentListOf( - LimitPresetUM(label = "$0", onClick = {}), - LimitPresetUM(label = "$5,000", onClick = {}), - LimitPresetUM(label = "$10,000", onClick = {}), - LimitPresetUM(label = "$25,000", onClick = {}), + LimitPresetUM(label = "$0", testTag = "", onClick = {}), + LimitPresetUM(label = "$5,000", testTag = "", onClick = {}), + LimitPresetUM(label = "$10,000", testTag = "", onClick = {}), + LimitPresetUM(label = "$25,000", testTag = "", onClick = {}), ), submitButtonEnabled: Boolean = true, submitButtonLoading: Boolean = false, diff --git a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/ui/TangemPayDailyLimitBlock.kt b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/ui/TangemPayDailyLimitBlock.kt index 77d497c2ff..8f8cf0f980 100644 --- a/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/ui/TangemPayDailyLimitBlock.kt +++ b/features/tangempay/details/impl/src/main/kotlin/com/tangem/features/tangempay/ui/TangemPayDailyLimitBlock.kt @@ -15,6 +15,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.layout.layoutId +import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.vectorResource import androidx.compose.ui.text.style.TextOverflow @@ -34,6 +35,7 @@ import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.res.* import com.tangem.core.ui.res.generated.icons.Icons import com.tangem.core.ui.res.generated.icons.ic_arrow_refresh_32 +import com.tangem.core.ui.test.TangemPayTestTags import com.tangem.features.tangempay.details.impl.R import com.tangem.features.tangempay.entity.TangemPayDailyLimitBlockState @@ -159,7 +161,8 @@ private fun CurrentLimitBlockV2(state: TangemPayDailyLimitBlockState, modifier: TangemButton( modifier = Modifier .padding(start = TangemTheme.dimens2.x3) - .layoutId(TangemRowLayoutId.TAIL), + .layoutId(TangemRowLayoutId.TAIL) + .testTag(TangemPayTestTags.DAILY_LIMIT_CHANGE_BUTTON), variant = TangemButton.Variant.Secondary, text = resourceReference(R.string.tangempay_card_page_daily_limit_change), onClick = state.onChangeClick, @@ -264,7 +267,7 @@ private fun SubtitleLimit(state: TangemPayDailyLimitBlockState, modifier: Modifi } is TangemPayDailyLimitBlockState.Content -> { Text( - modifier = modifier, + modifier = modifier.testTag(TangemPayTestTags.DAILY_LIMIT_CURRENT_VALUE), text = state.limit, style = TangemTheme.typography3.body.medium, color = TangemTheme.colors3.text.primary,