Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-13 16:33:00 +05:00
parent fc329a75d9
commit 8d43a9eed3
3 changed files with 16 additions and 19 deletions

View file

@ -60,14 +60,19 @@ fun BaseTestCase.openMarketsScreen() {
}
}
fun BaseTestCase.openMarketsExchangesScreen(tokenName: String) {
fun BaseTestCase.openMarketsExchangesScreen(tokenName: String, shouldClickSeeAllButton: Boolean = false) {
openMarketsScreen()
if (shouldClickSeeAllButton)
step("Click on 'See all' button") {
onMarketsScreen { seeAllButton.clickWithAssertion() }
}
step("Click on '$tokenName' token") {
onMarketsScreen { tokenWithTitle(tokenName).clickWithAssertion() }
waitForIdle()
}
step("Scroll down") {
swipeVertical(SwipeDirection.UP)
swipeVertical(SwipeDirection.UP)
}
step("Click on 'Listed on exchanges' block") {
onMarketsScreen { listedOnBlockContainer.performClick() }

View file

@ -113,6 +113,7 @@ class TotalBalanceUnavailableTest : BaseTestCase() {
val scenarioName = "user_tokens_api"
val scenarioState = "CustomTokenAdded"
val tokenTitle = "Myria"
val balance = "$3,299.18"
setupHooks(
additionalAfterSection = {
resetWireMockScenarioState(scenarioName)
@ -134,8 +135,8 @@ class TotalBalanceUnavailableTest : BaseTestCase() {
}
}
}
step("Assert dash sign is displayed in total balance") {
onMainScreen { totalBalanceText.assertTextContains(DASH_SIGN) }
step("Assert correct balance is displayed in total balance") {
onMainScreen { totalBalanceText.assertTextContains(balance) }
}
step("Assert $tokenTitle is unreachable") {
onMainScreen { tokenWithTitleAndPosition(tokenTitle, 4).assertIsUnreachable() }

View file

@ -8,7 +8,10 @@ import com.tangem.common.utils.resetWireMockScenarioState
import com.tangem.common.utils.setWireMockScenarioState
import com.tangem.datasource.api.common.config.ApiConfig
import com.tangem.datasource.api.common.config.ApiEnvironment
import com.tangem.scenarios.*
import com.tangem.scenarios.assertMarketsExchangesScreen
import com.tangem.scenarios.openMainScreen
import com.tangem.scenarios.openMarketsExchangesScreen
import com.tangem.scenarios.synchronizeAddresses
import com.tangem.screens.onMarketsExchangesScreen
import com.tangem.screens.onMarketsScreen
import dagger.hilt.android.testing.HiltAndroidTest
@ -26,21 +29,8 @@ class MarketsExchangesTest : BaseTestCase() {
fun marketsExchangesListTest() {
val tokenName = "Solana"
setupHooks().run {
step("Open 'Markets' screen") {
openMarketsScreen()
}
step("Click on 'See all' button") {
onMarketsScreen { seeAllButton.clickWithAssertion() }
}
step("Click on '$tokenName' token") {
onMarketsScreen { tokenWithTitle(tokenName).clickWithAssertion() }
waitForIdle()
}
step("Scroll down") {
swipeVertical(SwipeDirection.UP)
}
step("Click on 'Listed on exchanges' block") {
onMarketsScreen { listedOnBlockContainer.performClick() }
step("Open 'Markets Exhanges Screen with token: $tokenName'") {
openMarketsExchangesScreen(tokenName = tokenName, shouldClickSeeAllButton = true)
}
step("Assert 'Exchanges' list screen is displayed") {
assertMarketsExchangesScreen()
@ -71,6 +61,7 @@ class MarketsExchangesTest : BaseTestCase() {
}
step("Scroll down") {
swipeVertical(SwipeDirection.UP)
swipeVertical(SwipeDirection.UP)
}
step("Assert 'Listed on exchanges' block has title") {
onMarketsScreen { listedOnBlockContainer.assertIsDisplayed() }