From 3fe7585ba8dde6c44f136f67d407b0b8f4366f4a Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 4 May 2026 12:21:04 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/scenarios/BaseScenarios.kt | 10 +++---- .../tangem/screens/MainScreenPageObject.kt | 27 ++++++++++++++++--- .../kotlin/com/tangem/tests/FeedbackTest.kt | 4 --- .../com/tangem/tests/TermsOfServiceTest.kt | 3 +++ 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/app/src/androidTest/kotlin/com/tangem/scenarios/BaseScenarios.kt b/app/src/androidTest/kotlin/com/tangem/scenarios/BaseScenarios.kt index beb2b2d14f..22a818f96c 100644 --- a/app/src/androidTest/kotlin/com/tangem/scenarios/BaseScenarios.kt +++ b/app/src/androidTest/kotlin/com/tangem/scenarios/BaseScenarios.kt @@ -20,9 +20,6 @@ fun BaseTestCase.scanCard( productType != null -> MockProvider.setMocks(productType) else -> MockProvider.setMocks(ProductType.Wallet) } - step("Click on 'Accept' button") { - onDisclaimerScreen { acceptButton.clickWithAssertion() } - } step("Click on 'Get started' button") { onStoriesScreen { getStartedButton.clickWithAssertion() } } @@ -60,9 +57,6 @@ fun BaseTestCase.openMainScreen( } fun BaseTestCase.openMainScreenWithExistingHotWallet(seedPhrase: String) { - step("Click on 'Accept' button") { - onDisclaimerScreen { acceptButton.clickWithAssertion() } - } step("Click on 'Get started' button") { onStoriesScreen { getStartedButton.clickWithAssertion() } } @@ -134,6 +128,10 @@ fun BaseTestCase.synchronizeAddresses( onMainScreen { totalBalanceText.assert(!hasText(DASH_SIGN)) } } } + + step("Expand 'Main account' to reveal tokens") { + onMainScreen { mainAccount().performClick() } + } } fun BaseTestCase.openDeviceSettingsScreen() { diff --git a/app/src/androidTest/kotlin/com/tangem/screens/MainScreenPageObject.kt b/app/src/androidTest/kotlin/com/tangem/screens/MainScreenPageObject.kt index 79bc25c0f5..abdbaeb2a7 100644 --- a/app/src/androidTest/kotlin/com/tangem/screens/MainScreenPageObject.kt +++ b/app/src/androidTest/kotlin/com/tangem/screens/MainScreenPageObject.kt @@ -219,6 +219,24 @@ class MainScreenPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) useUnmergedTree = true } + /** + * Main account header on the main screen. Click to expand/collapse its tokens list. + */ + fun mainAccount(): LazyListItemNode = accountWithName(getResourceString(CoreUiR.string.account_main_account_title)) + + /** + * Account header on the main screen, located by its visible name. Click to expand/collapse its tokens list. + * The account's title text lives on a descendant of the test-tagged node, so we match by descendant. + */ + @OptIn(ExperimentalTestApi::class) + fun accountWithName(name: String): LazyListItemNode { + return lazyList.childWith { + hasTestTag(MainScreenTestTags.TOKEN_LIST_ITEM) + hasAnyDescendant(withText(name)) + useUnmergedTree = true + } + } + /** * Find token list item with title and address */ @@ -226,7 +244,8 @@ class MainScreenPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) fun tokenWithTitleAndAddress(tokenTitle: String): KNode { return lazyList.childWith { hasTestTag(MainScreenTestTags.TOKEN_LIST_ITEM) - hasText(tokenTitle) + hasAnyDescendant(withText(tokenTitle)) + useUnmergedTree = true }.child { hasTestTag(TokenElementsTestTags.TOKEN_FIAT_AMOUNT) useUnmergedTree = true @@ -237,7 +256,8 @@ class MainScreenPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) fun tokenWithCustomDerivationIcon(tokenTitle: String): KNode { return lazyList.childWith { hasTestTag(MainScreenTestTags.TOKEN_LIST_ITEM) - hasText(tokenTitle) + hasAnyDescendant(withText(tokenTitle)) + useUnmergedTree = true }.child { hasTestTag(TokenElementsTestTags.TOKEN_CUSTOM_DERIVATION_ICON) useUnmergedTree = true @@ -277,8 +297,9 @@ class MainScreenPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) fun tokenWithTitleAndPosition(tokenTitle: String, index: Int): KNode { return lazyList.childWith { hasTestTag(MainScreenTestTags.TOKEN_LIST_ITEM) - hasText(tokenTitle) + hasAnyDescendant(withText(tokenTitle)) hasLazyListItemPosition(index) + useUnmergedTree = true }.child { hasTestTag(TokenElementsTestTags.TOKEN_TITLE) useUnmergedTree = true diff --git a/app/src/androidTest/kotlin/com/tangem/tests/FeedbackTest.kt b/app/src/androidTest/kotlin/com/tangem/tests/FeedbackTest.kt index 6f103dd4b6..b7fa3d9c5b 100644 --- a/app/src/androidTest/kotlin/com/tangem/tests/FeedbackTest.kt +++ b/app/src/androidTest/kotlin/com/tangem/tests/FeedbackTest.kt @@ -18,7 +18,6 @@ import com.tangem.scenarios.synchronizeAddresses import com.tangem.screens.ThirdPartyAppPageObject import com.tangem.screens.onCreateWalletStartScreen import com.tangem.screens.onDetailsScreen -import com.tangem.screens.onDisclaimerScreen import com.tangem.screens.onFailedTransactionDialog import com.tangem.screens.onMainScreen import com.tangem.screens.onScanWarningDialog @@ -165,9 +164,6 @@ class FeedbackTest : BaseTestCase() { MockProvider.resetEmulateError() } ).run { - step("Click on 'Accept' button") { - onDisclaimerScreen { acceptButton.clickWithAssertion() } - } step("Set scanning error") { MockProvider.setEmulateError(TangemSdkError.TagLost()) } diff --git a/app/src/androidTest/kotlin/com/tangem/tests/TermsOfServiceTest.kt b/app/src/androidTest/kotlin/com/tangem/tests/TermsOfServiceTest.kt index 046964ff53..aa60f6632a 100644 --- a/app/src/androidTest/kotlin/com/tangem/tests/TermsOfServiceTest.kt +++ b/app/src/androidTest/kotlin/com/tangem/tests/TermsOfServiceTest.kt @@ -10,6 +10,7 @@ import com.tangem.screens.onStoriesScreen import dagger.hilt.android.testing.HiltAndroidTest import io.qameta.allure.kotlin.AllureId import io.qameta.allure.kotlin.junit4.DisplayName +import org.junit.Ignore import org.junit.Test @HiltAndroidTest @@ -18,6 +19,7 @@ class TermsOfServiceTest : BaseTestCase() { @AllureId("3573") @DisplayName("ToS: success acceptance") @Test + @Ignore("[REDACTED_JIRA]") fun validateTermsOfServiceScreenTest() { setupHooks().run { val tosUrl = "https://tangem.com/tangem_tos.html" @@ -46,6 +48,7 @@ class TermsOfServiceTest : BaseTestCase() { @AllureId("3574") @DisplayName("ToS: accept after app restart") @Test + @Ignore("[REDACTED_JIRA]") fun acceptTermsOfServiceAfterAppRestart() { val packageName = getTargetContext().packageName val tosUrl = "https://tangem.com/tangem_tos.html"