Updated on 2026-08-14
This commit is contained in:
parent
7595aeb6fa
commit
e25e8e66c7
6 changed files with 17 additions and 62 deletions
|
|
@ -61,20 +61,10 @@ class BuyTokenDetailsPageObject(semanticsProvider: SemanticsNodeInteractionsProv
|
|||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
val tokenAmountField: KNode = child {
|
||||
hasParent(withTestTag(BuyTokenDetailsScreenTestTags.TOKEN_AMOUNT))
|
||||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
val recommendedTitle: KNode = child {
|
||||
hasText(getResourceString(OnrampImplR.string.onramp_recommended_title))
|
||||
}
|
||||
|
||||
val bestRateIcon: KNode = child {
|
||||
hasTestTag(OnrampOffersBlockTestTags.BEST_RATE_ICON)
|
||||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
val bestRateTitle: KNode = child {
|
||||
hasTestTag(OnrampOffersBlockTestTags.BEST_RATE_TITLE)
|
||||
useUnmergedTree = true
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class BuyTokenTest : BaseTestCase() {
|
|||
val otherCurrenciesTitle = "Other currencies"
|
||||
val australianDollar = "AUD"
|
||||
val fiatAmount = "1"
|
||||
val tokenAmount = "~488.24938338 POL"
|
||||
val tokenAmount = "POL 488.24938338"
|
||||
val scenarioName = "payment_methods"
|
||||
|
||||
step("Reset WireMock scenario '$scenarioName'") {
|
||||
|
|
@ -98,10 +98,8 @@ class BuyTokenTest : BaseTestCase() {
|
|||
step("Write fiat amount = '$fiatAmount'") {
|
||||
onBuyTokenDetailsScreen { fiatAmountTextField.performTextInput(fiatAmount) }
|
||||
}
|
||||
step("Assert token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen {
|
||||
tokenAmountField.assertTextContains(tokenAmount)
|
||||
}
|
||||
step("Assert offer token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen { offerTokenAmount.assertTextContains(tokenAmount) }
|
||||
}
|
||||
step("Fiat currency icon is displayed") {
|
||||
onBuyTokenDetailsScreen { fiatCurrencyIcon.assertIsDisplayed() }
|
||||
|
|
@ -129,10 +127,8 @@ class BuyTokenTest : BaseTestCase() {
|
|||
fiatAmountTextField.assertTextContains(australianDollar + fiatAmount)
|
||||
}
|
||||
}
|
||||
step("Assert token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen {
|
||||
tokenAmountField.assertTextContains(tokenAmount)
|
||||
}
|
||||
step("Assert offer token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen { offerTokenAmount.assertTextContains(tokenAmount) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -145,7 +141,7 @@ class BuyTokenTest : BaseTestCase() {
|
|||
val tokenTitle = "Polygon"
|
||||
val euro = "EUR"
|
||||
val fiatAmount = "1"
|
||||
val tokenAmount = "~488.24938338 POL"
|
||||
val tokenAmount = "POL 488.24938338"
|
||||
val scenarioName = "payment_methods"
|
||||
|
||||
step("Reset WireMock scenario '$scenarioName'") {
|
||||
|
|
@ -182,18 +178,12 @@ class BuyTokenTest : BaseTestCase() {
|
|||
step("Assert fiat amount = '$fiatAmount'") {
|
||||
onBuyTokenDetailsScreen { fiatAmountTextField.assertTextContains(euro + fiatAmount) }
|
||||
}
|
||||
step("Assert token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen { tokenAmountField.assertTextContains(tokenAmount) }
|
||||
}
|
||||
step("Click on 'Continue' button") {
|
||||
onBuyTokenDetailsScreen { continueButton.clickWithAssertion() }
|
||||
step("Assert offer token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen { offerTokenAmount.assertTextContains(tokenAmount) }
|
||||
}
|
||||
step("Assert 'Recommended' title is displayed") {
|
||||
onBuyTokenDetailsScreen { recommendedTitle.clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Best rate' icon is displayed") {
|
||||
onBuyTokenDetailsScreen { bestRateIcon.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert 'Best rate' title is displayed") {
|
||||
onBuyTokenDetailsScreen { bestRateTitle.assertIsDisplayed() }
|
||||
}
|
||||
|
|
@ -316,7 +306,7 @@ class BuyTokenTest : BaseTestCase() {
|
|||
val paymentMethod = "Invoice Revolut Pay"
|
||||
val fiatAmount = "1"
|
||||
val providerNameMercuryo = "Mercuryo"
|
||||
val tokenAmount = "~488.24938338 POL"
|
||||
val tokenAmount = "POL 488.24938338"
|
||||
val scenarioName = "payment_methods"
|
||||
|
||||
step("Reset WireMock scenario '$scenarioName'") {
|
||||
|
|
@ -344,11 +334,8 @@ class BuyTokenTest : BaseTestCase() {
|
|||
step("Write fiat amount = '$fiatAmount'") {
|
||||
onBuyTokenDetailsScreen { fiatAmountTextField.performTextInput(fiatAmount) }
|
||||
}
|
||||
step("Assert token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen { tokenAmountField.assertTextContains(tokenAmount) }
|
||||
}
|
||||
step("Click on 'Continue' button") {
|
||||
onBuyTokenDetailsScreen { continueButton.clickWithAssertion() }
|
||||
step("Assert offer token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen { offerTokenAmount.assertTextContains(tokenAmount) }
|
||||
}
|
||||
step("Assert 'Provider block' is displayed") {
|
||||
onBuyTokenDetailsScreen { providerName.assertIsDisplayed() }
|
||||
|
|
@ -365,9 +352,6 @@ class BuyTokenTest : BaseTestCase() {
|
|||
step("Assert 'Provider' bottom sheet subtitle is displayed") {
|
||||
onSelectProviderBottomSheet { subtitle.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert 'Best rate' icon is displayed") {
|
||||
onSelectProviderBottomSheet { bestRateIcon.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert 'Best rate' title is displayed") {
|
||||
onSelectProviderBottomSheet { bestRateTitle.assertIsDisplayed() }
|
||||
}
|
||||
|
|
@ -406,7 +390,7 @@ class BuyTokenTest : BaseTestCase() {
|
|||
val invoiceRevolutPay = "Invoice Revolut Pay"
|
||||
val sepa = "Sepa"
|
||||
val fiatAmount = "1"
|
||||
val tokenAmount = "~488.24938338 POL"
|
||||
val tokenAmount = "POL 488.24938338"
|
||||
val scenarioName = "payment_methods"
|
||||
|
||||
step("Reset WireMock scenario '$scenarioName'") {
|
||||
|
|
@ -434,11 +418,8 @@ class BuyTokenTest : BaseTestCase() {
|
|||
step("Write fiat amount = '$fiatAmount'") {
|
||||
onBuyTokenDetailsScreen { fiatAmountTextField.performTextInput(fiatAmount) }
|
||||
}
|
||||
step("Assert token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen { tokenAmountField.assertTextContains(tokenAmount) }
|
||||
}
|
||||
step("Click on 'Continue' button") {
|
||||
onBuyTokenDetailsScreen { continueButton.clickWithAssertion() }
|
||||
step("Assert offer token amount = '$tokenAmount'") {
|
||||
onBuyTokenDetailsScreen { offerTokenAmount.assertTextContains(tokenAmount) }
|
||||
}
|
||||
step("Assert 'Provider block' is displayed") {
|
||||
onBuyTokenDetailsScreen { providerName.assertIsDisplayed() }
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ class MainScreenActionButtonsTest : BaseTestCase() {
|
|||
@Test
|
||||
fun clickOnBuyButtonTest() {
|
||||
val tokenTitle = "Bitcoin"
|
||||
val tokenSymbol = "BTC"
|
||||
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen'") {
|
||||
|
|
@ -165,12 +164,6 @@ class MainScreenActionButtonsTest : BaseTestCase() {
|
|||
step("Assert fiat currency icon is displayed") {
|
||||
onBuyTokenDetailsScreen { fiatCurrencyIcon.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert token amount field is displayed") {
|
||||
onBuyTokenDetailsScreen { tokenAmountField.assertTextContains(tokenSymbol, substring = true) }
|
||||
}
|
||||
step("Assert 'Continue' button") {
|
||||
onBuyTokenDetailsScreen { continueButton.assertIsDisplayed() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -381,7 +374,6 @@ class MainScreenActionButtonsTest : BaseTestCase() {
|
|||
val cardType: MockContent = TwinsMockContent
|
||||
val cardName = "Twin"
|
||||
val tokenTitle = "Bitcoin"
|
||||
val tokenSymbol = "BTC"
|
||||
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen' on '$cardName' card") {
|
||||
|
|
@ -406,12 +398,6 @@ class MainScreenActionButtonsTest : BaseTestCase() {
|
|||
step("Assert fiat currency icon is displayed") {
|
||||
onBuyTokenDetailsScreen { fiatCurrencyIcon.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert token amount field is displayed") {
|
||||
onBuyTokenDetailsScreen { tokenAmountField.assertTextContains(tokenSymbol, substring = true) }
|
||||
}
|
||||
step("Assert 'Continue' button") {
|
||||
onBuyTokenDetailsScreen { continueButton.assertIsDisplayed() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import org.junit.Test
|
|||
@HiltAndroidTest
|
||||
class SendAddressScreenTest : BaseTestCase() {
|
||||
|
||||
@AllureId("4006")
|
||||
@AllureId("4005")
|
||||
@DisplayName("Send (address screen): check address history")
|
||||
@Test
|
||||
fun sendAddressHistoryTest() {
|
||||
|
|
|
|||
|
|
@ -104,8 +104,7 @@ private fun OnrampAmountSecondary(state: OnrampAmountSecondaryFieldUM) {
|
|||
top = TangemTheme.dimens.spacing8,
|
||||
start = TangemTheme.dimens.spacing12,
|
||||
end = TangemTheme.dimens.spacing12,
|
||||
)
|
||||
.testTag(BuyTokenDetailsScreenTestTags.TOKEN_AMOUNT),
|
||||
),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
when (state) {
|
||||
|
|
|
|||
|
|
@ -135,8 +135,7 @@ private fun OnrampAmountSecondary(state: OnrampSecondaryFieldErrorUM.Error) {
|
|||
top = TangemTheme.dimens.spacing8,
|
||||
start = TangemTheme.dimens.spacing12,
|
||||
end = TangemTheme.dimens.spacing12,
|
||||
)
|
||||
.testTag(BuyTokenDetailsScreenTestTags.TOKEN_AMOUNT),
|
||||
),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Text(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue