Updated on 2026-08-14
This commit is contained in:
parent
32632f7309
commit
fb9ba88c84
2 changed files with 10 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.tests.main
|
||||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.USER_TOKENS_API_SCENARIO
|
||||
import com.tangem.common.extensions.clickWithAssertion
|
||||
import com.tangem.common.utils.resetWireMockScenarioState
|
||||
import com.tangem.common.utils.setWireMockScenarioState
|
||||
|
|
@ -27,16 +28,15 @@ class OrganizeTokensTest : BaseTestCase() {
|
|||
@DisplayName("Organize tokens: Correct tokens list displaying for current wallet")
|
||||
@Test
|
||||
fun organizeTokensCorrectTokensListDisplaying() {
|
||||
val userTokensScenario = "user_tokens_api"
|
||||
val userTokensState = "Wallet2MockTokensList"
|
||||
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(userTokensScenario)
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Set WireMock scenario: '$userTokensScenario' to state: '$userTokensState'") {
|
||||
setWireMockScenarioState(userTokensScenario, userTokensState)
|
||||
step("Set WireMock scenario: '$USER_TOKENS_API_SCENARIO' to state: '$userTokensState'") {
|
||||
setWireMockScenarioState(USER_TOKENS_API_SCENARIO, userTokensState)
|
||||
}
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen()
|
||||
|
|
@ -83,6 +83,9 @@ class OrganizeTokensTest : BaseTestCase() {
|
|||
val sourceIndex = 2
|
||||
val destinationIndex = 1
|
||||
val before = getDisplayedTokenTitles()
|
||||
require(before.size > sourceIndex && before.size > destinationIndex) {
|
||||
"Expected at least ${maxOf(sourceIndex, destinationIndex) + 1} tokens to reorder, but got ${before.size}: $before"
|
||||
}
|
||||
dragToken(source = before[sourceIndex], destination = before[destinationIndex])
|
||||
val expected = before.toMutableList().apply {
|
||||
add(destinationIndex, removeAt(sourceIndex))
|
||||
|
|
|
|||
|
|
@ -57,12 +57,11 @@ class TokenListTest : BaseTestCase() {
|
|||
@DisplayName("Main: token list differs after switching to a second wallet")
|
||||
@Test
|
||||
fun tokenListChangedAfterSwitchingWalletTest() {
|
||||
val userTokensScenario = "user_tokens_api"
|
||||
val userTokensState = "ReducedTokens"
|
||||
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(userTokensScenario)
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Open 'Main Screen'") {
|
||||
|
|
@ -74,8 +73,8 @@ class TokenListTest : BaseTestCase() {
|
|||
|
||||
val firstWalletTokens = getMainScreenTokensOrder()
|
||||
|
||||
step("Set WireMock scenario: '$userTokensScenario' to state: '$userTokensState'") {
|
||||
setWireMockScenarioState(userTokensScenario, userTokensState)
|
||||
step("Set WireMock scenario: '$USER_TOKENS_API_SCENARIO' to state: '$userTokensState'") {
|
||||
setWireMockScenarioState(USER_TOKENS_API_SCENARIO, userTokensState)
|
||||
}
|
||||
step("Add a second card wallet") {
|
||||
addNewCardWalletWithoutSync(Wallet2MockContent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue