Updated on 2026-08-14
This commit is contained in:
parent
5c74278e3d
commit
d9d8e9b500
7 changed files with 86 additions and 150 deletions
|
|
@ -2,17 +2,16 @@ package com.tangem.tests.actionButtons
|
|||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.WAIT_UNTIL_TIMEOUT
|
||||
import com.tangem.common.extensions.SwipeDirection
|
||||
import com.tangem.common.extensions.assertIsDimmed
|
||||
import com.tangem.common.extensions.clickWithAssertion
|
||||
import com.tangem.common.extensions.swipeVertical
|
||||
import com.tangem.common.utils.resetWireMockScenarioState
|
||||
import com.tangem.common.utils.setWireMockScenarioState
|
||||
import com.tangem.scenarios.checkQrCodeBottomSheetScenario
|
||||
import com.tangem.scenarios.goToQrCodeBottomSheet
|
||||
import com.tangem.scenarios.openMainScreen
|
||||
import com.tangem.scenarios.synchronizeAddresses
|
||||
import com.tangem.screens.*
|
||||
import com.tangem.screens.onMainScreen
|
||||
import com.tangem.screens.onSwapStoriesScreen
|
||||
import com.tangem.screens.onSwapTokenScreen
|
||||
import com.tangem.screens.onTokenDetailsScreen
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
import io.qameta.allure.kotlin.junit4.DisplayName
|
||||
|
|
@ -124,97 +123,6 @@ class TokenDetailsScreenActionButtonsTest : BaseTestCase() {
|
|||
}
|
||||
}
|
||||
|
||||
@AllureId("4460")
|
||||
@DisplayName("Action buttons (token details screen): check 'Swap' button (provider error)")
|
||||
@Test
|
||||
fun checkSwapButtonProviderErrorTest() {
|
||||
val tokenTitle = "POL (ex-MATIC)"
|
||||
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen()
|
||||
}
|
||||
step("Synchronize addresses") {
|
||||
synchronizeAddresses()
|
||||
}
|
||||
step("Swipe up") {
|
||||
swipeVertical(SwipeDirection.UP)
|
||||
}
|
||||
step("Click on token with name: '$tokenTitle'") {
|
||||
waitForIdle()
|
||||
onMainScreen { tokenWithTitleAndAddress(tokenTitle).performClick() }
|
||||
}
|
||||
step("Assert 'Swap' button is dimmed") {
|
||||
onTokenDetailsScreen { swapButton().assertIsDimmed() }
|
||||
}
|
||||
step("Click on 'Swap' button") {
|
||||
onTokenDetailsScreen { swapButton().performClick() }
|
||||
}
|
||||
step("Assert swapping $tokenTitle is not supported dialog text is displayed") {
|
||||
onSwapIsNotSupportedDialog { text(tokenTitle).assertIsDisplayed() }
|
||||
}
|
||||
step("Assert 'Ok' button is displayed") {
|
||||
onSwapIsNotSupportedDialog { okButton.assertIsDisplayed() }
|
||||
}
|
||||
step("Click on 'Ok' button") {
|
||||
onSwapIsNotSupportedDialog { okButton.performClick() }
|
||||
}
|
||||
step("Assert 'Swap' button is dimmed") {
|
||||
onTokenDetailsScreen { swapButton().assertIsDimmed() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@AllureId("4461")
|
||||
@DisplayName("Action buttons (token details screen): check 'Swap' button (Express error)")
|
||||
@Test
|
||||
fun checkSwapButtonExpressErrorTest() {
|
||||
val tokenTitle = "Polygon"
|
||||
val scenarioName = "express_api_assets"
|
||||
val scenarioState = "Error"
|
||||
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(scenarioName)
|
||||
}
|
||||
).run {
|
||||
step("Set WireMock scenario: '$scenarioName' to state: '$scenarioState'") {
|
||||
setWireMockScenarioState(scenarioName, scenarioState)
|
||||
}
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen()
|
||||
}
|
||||
step("Synchronize addresses") {
|
||||
synchronizeAddresses()
|
||||
}
|
||||
step("Swipe up") {
|
||||
swipeVertical(SwipeDirection.UP)
|
||||
}
|
||||
step("Click on token with name: '$tokenTitle'") {
|
||||
waitForIdle()
|
||||
onMainScreen { tokenWithTitleAndAddress(tokenTitle).performClick() }
|
||||
}
|
||||
step("Assert 'Swap' button is dimmed") {
|
||||
onTokenDetailsScreen { swapButton().assertIsDimmed() }
|
||||
}
|
||||
step("Click on 'Swap' button") {
|
||||
onTokenDetailsScreen { swapButton().performClick() }
|
||||
}
|
||||
step("Assert operation is unavailable dialog text is displayed") {
|
||||
onOperationIsUnavailableDialog { text.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert 'Ok' button is displayed") {
|
||||
onOperationIsUnavailableDialog { okButton.assertIsDisplayed() }
|
||||
}
|
||||
step("Click on 'Ok' button") {
|
||||
onOperationIsUnavailableDialog { okButton.performClick() }
|
||||
}
|
||||
step("Assert 'Swap' button is dimmed") {
|
||||
onTokenDetailsScreen { swapButton().assertIsDimmed() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@AllureId("3590")
|
||||
@DisplayName("Action buttons (token details screen): validate UI")
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue