Updated on 2026-08-14
This commit is contained in:
parent
16ef0331f9
commit
536334e6ce
9 changed files with 525 additions and 87 deletions
|
|
@ -16,6 +16,9 @@ object TestConstants {
|
|||
const val ENS_NAME = "louded.eth"
|
||||
const val ENS_ETHEREUM_RECIPIENT_ADDRESS = "0x0211ff638298adcbdc99c177dc2e95ec69948865"
|
||||
const val ENS_ETHEREUM_RECIPIENT_SHORTENED_ADDRESS = "0x0211ff63829..."
|
||||
const val KUSAMA_RECIPIENT_ADDRESS = "CqNrR92Hh76vW69vDBL5iATrZoYkk9nj67iVSUbb2YHtktn"
|
||||
const val AZERO_RECIPIENT_ADDRESS = "5EA4p6DZdbt2vLZySML2dG3ZsnNrenEWZHnVCScQh4iq2KZo"
|
||||
const val TEZOS_RECIPIENT_ADDRESS = "tz1eBdC2JkU2bxgZssweLo6D3wCkWN12ioHW"
|
||||
|
||||
const val WAIT_UNTIL_TIMEOUT = 20_000L
|
||||
const val WAIT_UNTIL_TIMEOUT_LONG = 30_000L
|
||||
|
|
@ -24,4 +27,7 @@ object TestConstants {
|
|||
|
||||
const val ALLURE_LABEL_NAME = "Owner"
|
||||
const val ALLURE_LABEL_VALUE = "Kaspresso"
|
||||
|
||||
const val USER_TOKENS_API_SCENARIO = "user_tokens_api"
|
||||
const val QUOTES_API_SCENARIO = "quotes_api"
|
||||
}
|
||||
|
|
@ -1,15 +1,43 @@
|
|||
package com.tangem.scenarios
|
||||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.QUOTES_API_SCENARIO
|
||||
import com.tangem.common.constants.TestConstants.USER_TOKENS_API_SCENARIO
|
||||
import com.tangem.common.extensions.clickWithAssertion
|
||||
import com.tangem.common.utils.setWireMockScenarioState
|
||||
import com.tangem.screens.onMainScreen
|
||||
import com.tangem.screens.onSendConfirmScreen
|
||||
import com.tangem.screens.onTokenDetailsScreen
|
||||
import io.github.kakaocup.compose.node.element.KNode
|
||||
import io.qameta.allure.kotlin.Allure.step
|
||||
|
||||
fun BaseTestCase.openSendScreen(tokenName: String) {
|
||||
step("Set WireMock scenario: '$USER_TOKENS_API_SCENARIO' to state: '$tokenName'") {
|
||||
setWireMockScenarioState(scenarioName = USER_TOKENS_API_SCENARIO, state = tokenName)
|
||||
}
|
||||
step("Set WireMock scenario: '$QUOTES_API_SCENARIO' to state: '$tokenName'") {
|
||||
setWireMockScenarioState(scenarioName = QUOTES_API_SCENARIO, state = tokenName)
|
||||
}
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen()
|
||||
}
|
||||
step("Synchronize addresses") {
|
||||
synchronizeAddresses()
|
||||
}
|
||||
step("Click on token with name: '$tokenName'") {
|
||||
onMainScreen { tokenWithTitleAndAddress(tokenName).clickWithAssertion() }
|
||||
}
|
||||
step("Click on 'Send' button") {
|
||||
onTokenDetailsScreen { sendButton().performClick() }
|
||||
}
|
||||
}
|
||||
|
||||
fun BaseTestCase.checkSendWarning(
|
||||
titleResId: Int,
|
||||
messageResId: Int,
|
||||
amount: String,
|
||||
isDisplayed: Boolean = true,
|
||||
sendButtonIsDisabled: Boolean = isDisplayed,
|
||||
) {
|
||||
val assertDisplay = if (isDisplayed) "displayed" else "not displayed"
|
||||
|
||||
|
|
@ -27,14 +55,13 @@ fun BaseTestCase.checkSendWarning(
|
|||
onSendConfirmScreen {
|
||||
sendWarningIcon(messageResId, amount).assertVisibility(isDisplayed)
|
||||
}
|
||||
|
||||
}
|
||||
step("Assert warning message is $assertDisplay") {
|
||||
onSendConfirmScreen {
|
||||
sendWarningMessage(messageResId, amount).assertVisibility(isDisplayed)
|
||||
}
|
||||
}
|
||||
if (isDisplayed)
|
||||
if (sendButtonIsDisabled)
|
||||
step("Assert 'Send' button is disabled") {
|
||||
onSendConfirmScreen {
|
||||
sendButton.assertIsNotEnabled()
|
||||
|
|
|
|||
|
|
@ -35,6 +35,12 @@ class SendConfirmPageObject(semanticsProvider: SemanticsNodeInteractionsProvider
|
|||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
fun reduceAmountButton(amount: String): KNode = child {
|
||||
hasTestTag(BaseButtonTestTags.BUTTON)
|
||||
hasAnyDescendant(withText(getResourceString(R.string.send_notification_reduce_by, amount)))
|
||||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
fun warningTitle(titleResId: Int): KNode = child {
|
||||
hasTestTag(NotificationTestTags.TITLE)
|
||||
hasText(getResourceString(titleResId))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
package com.tangem.tests.send.warnings
|
||||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.AZERO_RECIPIENT_ADDRESS
|
||||
import com.tangem.common.constants.TestConstants.QUOTES_API_SCENARIO
|
||||
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.scenarios.checkSendWarning
|
||||
import com.tangem.scenarios.openSendScreen
|
||||
import com.tangem.screens.onSendAddressScreen
|
||||
import com.tangem.screens.onSendConfirmScreen
|
||||
import com.tangem.screens.onSendScreen
|
||||
import com.tangem.wallet.R
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
import org.junit.Test
|
||||
|
||||
@HiltAndroidTest
|
||||
class AzeroWarningsTest : BaseTestCase() {
|
||||
private val tokenName = "Aleph Zero"
|
||||
private val amountToLeaveLessThanDeposit = "0.099876587544"
|
||||
private val amountToLeaveGreaterThanDeposit = "0.09"
|
||||
private val depositAmount = "AZERO 0.0000000005"
|
||||
|
||||
private val warningTitleResId = R.string.send_notification_existential_deposit_title
|
||||
private val warningMessageResId = R.string.send_notification_existential_deposit_text
|
||||
|
||||
@AllureId("4290")
|
||||
@Test
|
||||
fun checkWarning() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Type '$amountToLeaveLessThanDeposit' in input text field") {
|
||||
onSendScreen {
|
||||
amountInputTextField.performClick()
|
||||
amountInputTextField.performTextReplacement(amountToLeaveLessThanDeposit)
|
||||
}
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Type address in input text field") {
|
||||
onSendAddressScreen { addressTextField.performTextReplacement(AZERO_RECIPIENT_ADDRESS) }
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendAddressScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount
|
||||
)
|
||||
}
|
||||
step("Click on 'Leave $depositAmount' button") {
|
||||
onSendConfirmScreen { leaveDepositButton(depositAmount).clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is not displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount,
|
||||
isDisplayed = false
|
||||
)
|
||||
}
|
||||
step("Click on 'Amount' field") {
|
||||
onSendConfirmScreen { primaryAmount.clickWithAssertion() }
|
||||
}
|
||||
step("Type '$amountToLeaveGreaterThanDeposit' in input text field") {
|
||||
onSendScreen {
|
||||
amountInputTextField.performClick()
|
||||
amountInputTextField.performTextReplacement(amountToLeaveGreaterThanDeposit)
|
||||
}
|
||||
}
|
||||
step("Click on 'Continue' button") {
|
||||
onSendScreen { continueButton.clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is not displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount,
|
||||
isDisplayed = false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.tangem.tests.send.warnings
|
||||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.KUSAMA_RECIPIENT_ADDRESS
|
||||
import com.tangem.common.constants.TestConstants.QUOTES_API_SCENARIO
|
||||
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.scenarios.checkSendWarning
|
||||
import com.tangem.scenarios.openSendScreen
|
||||
import com.tangem.screens.onSendAddressScreen
|
||||
import com.tangem.screens.onSendConfirmScreen
|
||||
import com.tangem.screens.onSendScreen
|
||||
import com.tangem.wallet.R
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
import org.junit.Test
|
||||
|
||||
@HiltAndroidTest
|
||||
class KusamaWarningsTest : BaseTestCase() {
|
||||
private val tokenName = "Kusama"
|
||||
private val amountToLeaveLessThanDeposit = "0.300333"
|
||||
private val amountToLeaveGreaterThanDeposit = "0.1"
|
||||
private val depositAmount = "KSM 0.000333333333"
|
||||
|
||||
private val warningTitleResId = R.string.send_notification_existential_deposit_title
|
||||
private val warningMessageResId = R.string.send_notification_existential_deposit_text
|
||||
|
||||
@AllureId("4291")
|
||||
@Test
|
||||
fun checkWarning() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Type '$amountToLeaveLessThanDeposit' in input text field") {
|
||||
onSendScreen {
|
||||
amountInputTextField.performClick()
|
||||
amountInputTextField.performTextReplacement(amountToLeaveLessThanDeposit)
|
||||
}
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Type address in input text field") {
|
||||
onSendAddressScreen { addressTextField.performTextReplacement(KUSAMA_RECIPIENT_ADDRESS) }
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendAddressScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount
|
||||
)
|
||||
}
|
||||
step("Click on 'Leave $depositAmount' button") {
|
||||
onSendConfirmScreen { leaveDepositButton(depositAmount).clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is not displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount,
|
||||
isDisplayed = false
|
||||
)
|
||||
}
|
||||
step("Click on 'Amount' field") {
|
||||
onSendConfirmScreen { primaryAmount.clickWithAssertion() }
|
||||
}
|
||||
step("Type '$amountToLeaveGreaterThanDeposit' in input text field") {
|
||||
onSendScreen {
|
||||
amountInputTextField.performClick()
|
||||
amountInputTextField.performTextReplacement(amountToLeaveGreaterThanDeposit)
|
||||
}
|
||||
}
|
||||
step("Click on 'Continue' button") {
|
||||
onSendScreen { continueButton.clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is not displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount,
|
||||
isDisplayed = false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.tangem.tests.send.warnings
|
||||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.POLKADOT_RECIPIENT_ADDRESS
|
||||
import com.tangem.common.constants.TestConstants.QUOTES_API_SCENARIO
|
||||
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.scenarios.checkSendWarning
|
||||
import com.tangem.scenarios.openSendScreen
|
||||
import com.tangem.screens.onSendAddressScreen
|
||||
import com.tangem.screens.onSendConfirmScreen
|
||||
import com.tangem.screens.onSendScreen
|
||||
import com.tangem.wallet.R
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
import org.junit.Test
|
||||
|
||||
@HiltAndroidTest
|
||||
class PolkadotWarningsTest : BaseTestCase() {
|
||||
private val tokenName = "Polkadot"
|
||||
private val amountToLeaveLessThanDeposit = "1.299"
|
||||
private val amountToLeaveGreaterThanDeposit = "0.2"
|
||||
private val depositAmount = "DOT 1.00"
|
||||
|
||||
private val warningTitleResId = R.string.send_notification_existential_deposit_title
|
||||
private val warningMessageResId = R.string.send_notification_existential_deposit_text
|
||||
|
||||
@AllureId("4289")
|
||||
@Test
|
||||
fun checkWarning() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Type '$amountToLeaveLessThanDeposit' in input text field") {
|
||||
onSendScreen {
|
||||
amountInputTextField.performClick()
|
||||
amountInputTextField.performTextReplacement(amountToLeaveLessThanDeposit)
|
||||
}
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Type address in input text field") {
|
||||
onSendAddressScreen { addressTextField.performTextReplacement(POLKADOT_RECIPIENT_ADDRESS) }
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendAddressScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount
|
||||
)
|
||||
}
|
||||
step("Click on 'Leave $depositAmount' button") {
|
||||
onSendConfirmScreen { leaveDepositButton(depositAmount).clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is not displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount,
|
||||
isDisplayed = false
|
||||
)
|
||||
}
|
||||
step("Click on 'Amount' field") {
|
||||
onSendConfirmScreen { primaryAmount.clickWithAssertion() }
|
||||
}
|
||||
step("Type '$amountToLeaveGreaterThanDeposit' in input text field") {
|
||||
onSendScreen {
|
||||
amountInputTextField.performClick()
|
||||
amountInputTextField.performTextReplacement(amountToLeaveGreaterThanDeposit)
|
||||
}
|
||||
}
|
||||
step("Click on 'Continue' button") {
|
||||
onSendScreen { continueButton.clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Existential deposit warning' is not displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = warningTitleResId,
|
||||
messageResId = warningMessageResId,
|
||||
amount = depositAmount,
|
||||
isDisplayed = false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +1,15 @@
|
|||
package com.tangem.tests.send.warnings
|
||||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.QUOTES_API_SCENARIO
|
||||
import com.tangem.common.constants.TestConstants.SOLANA_RECIPIENT_ADDRESS
|
||||
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
|
||||
import com.tangem.scenarios.checkSendWarning
|
||||
import com.tangem.scenarios.openMainScreen
|
||||
import com.tangem.scenarios.synchronizeAddresses
|
||||
import com.tangem.screens.onMainScreen
|
||||
import com.tangem.scenarios.openSendScreen
|
||||
import com.tangem.screens.onSendAddressScreen
|
||||
import com.tangem.screens.onSendScreen
|
||||
import com.tangem.screens.onTokenDetailsScreen
|
||||
import com.tangem.wallet.R
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
|
|
@ -24,10 +22,6 @@ class SolanaWarningsTest : BaseTestCase() {
|
|||
private val amountToLeaveLessThanRent = "0.0016941"
|
||||
private val amountToLeaveGreaterThanRent = "0.0000941"
|
||||
private val amountToLeaveRentOnly = "0.00168934"
|
||||
private val userTokensScenarioName = "user_tokens_api"
|
||||
private val userTokensScenarioState = "Solana"
|
||||
private val quotesScenarioName = "quotes_api"
|
||||
private val quotesScenarioState = "Solana"
|
||||
private val rentAmount = "0.000890880"
|
||||
|
||||
private val invalidAmountTitleResId = R.string.send_notification_invalid_amount_title
|
||||
|
|
@ -39,27 +33,12 @@ class SolanaWarningsTest : BaseTestCase() {
|
|||
fun warningIsDisplayedWhenLeaveLessThanRent() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(userTokensScenarioName)
|
||||
resetWireMockScenarioState(quotesScenarioName)
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Set WireMock scenario: '$userTokensScenarioName' to state: '$userTokensScenarioState'") {
|
||||
setWireMockScenarioState(scenarioName = userTokensScenarioName, state = userTokensScenarioState)
|
||||
}
|
||||
step("Set WireMock scenario: '$quotesScenarioName' to state: '$quotesScenarioState'") {
|
||||
setWireMockScenarioState(scenarioName = quotesScenarioName, state = quotesScenarioState)
|
||||
}
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen()
|
||||
}
|
||||
step("Synchronize addresses") {
|
||||
synchronizeAddresses()
|
||||
}
|
||||
step("Click on token with name: '$tokenName'") {
|
||||
onMainScreen { tokenWithTitleAndAddress(tokenName).clickWithAssertion() }
|
||||
}
|
||||
step("Click on 'Send' button") {
|
||||
onTokenDetailsScreen { sendButton().performClick() }
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Type '$amountToLeaveLessThanRent' in input text field") {
|
||||
onSendScreen {
|
||||
|
|
@ -92,27 +71,12 @@ class SolanaWarningsTest : BaseTestCase() {
|
|||
fun warningIsNotDisplayedWhenLeaveGreaterThanRent() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(userTokensScenarioName)
|
||||
resetWireMockScenarioState(quotesScenarioName)
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Set WireMock scenario: '$userTokensScenarioName' to state: '$userTokensScenarioState'") {
|
||||
setWireMockScenarioState(scenarioName = userTokensScenarioName, state = userTokensScenarioState)
|
||||
}
|
||||
step("Set WireMock scenario: '$quotesScenarioName' to state: '$quotesScenarioState'") {
|
||||
setWireMockScenarioState(scenarioName = quotesScenarioName, state = quotesScenarioState)
|
||||
}
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen()
|
||||
}
|
||||
step("Synchronize addresses") {
|
||||
synchronizeAddresses()
|
||||
}
|
||||
step("Click on token with name: '$tokenName'") {
|
||||
onMainScreen { tokenWithTitleAndAddress(tokenName).clickWithAssertion() }
|
||||
}
|
||||
step("Click on 'Send' button") {
|
||||
onTokenDetailsScreen { sendButton().performClick() }
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Type '$amountToLeaveGreaterThanRent' in input text field") {
|
||||
onSendScreen {
|
||||
|
|
@ -146,27 +110,12 @@ class SolanaWarningsTest : BaseTestCase() {
|
|||
fun warningIsNotDisplayedWhenLeaveOnlyRent() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(userTokensScenarioName)
|
||||
resetWireMockScenarioState(quotesScenarioName)
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Set WireMock scenario: '$userTokensScenarioName' to state: '$userTokensScenarioState'") {
|
||||
setWireMockScenarioState(scenarioName = userTokensScenarioName, state = userTokensScenarioState)
|
||||
}
|
||||
step("Set WireMock scenario: '$quotesScenarioName' to state: '$quotesScenarioState'") {
|
||||
setWireMockScenarioState(scenarioName = quotesScenarioName, state = quotesScenarioState)
|
||||
}
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen()
|
||||
}
|
||||
step("Synchronize addresses") {
|
||||
synchronizeAddresses()
|
||||
}
|
||||
step("Click on token with name: '$tokenName'") {
|
||||
onMainScreen { tokenWithTitleAndAddress(tokenName).clickWithAssertion() }
|
||||
}
|
||||
step("Click on 'Send' button") {
|
||||
onTokenDetailsScreen { sendButton().performClick() }
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Type '$amountToLeaveRentOnly' in input text field") {
|
||||
onSendScreen {
|
||||
|
|
@ -200,27 +149,12 @@ class SolanaWarningsTest : BaseTestCase() {
|
|||
fun warningIsNotDisplayedWhenLeaveZeroSol() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(userTokensScenarioName)
|
||||
resetWireMockScenarioState(quotesScenarioName)
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Set WireMock scenario: '$userTokensScenarioName' to state: '$userTokensScenarioState'") {
|
||||
setWireMockScenarioState(scenarioName = userTokensScenarioName, state = userTokensScenarioState)
|
||||
}
|
||||
step("Set WireMock scenario: '$quotesScenarioName' to state: '$quotesScenarioState'") {
|
||||
setWireMockScenarioState(scenarioName = quotesScenarioName, state = quotesScenarioState)
|
||||
}
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen()
|
||||
}
|
||||
step("Synchronize addresses") {
|
||||
synchronizeAddresses()
|
||||
}
|
||||
step("Click on token with name: '$tokenName'") {
|
||||
onMainScreen { tokenWithTitleAndAddress(tokenName).clickWithAssertion() }
|
||||
}
|
||||
step("Click on 'Send' button") {
|
||||
onTokenDetailsScreen { sendButton().performClick() }
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Type max amount in input text field") {
|
||||
onSendScreen {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,121 @@
|
|||
package com.tangem.tests.send.warnings
|
||||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.QUOTES_API_SCENARIO
|
||||
import com.tangem.common.constants.TestConstants.TEZOS_RECIPIENT_ADDRESS
|
||||
import com.tangem.common.constants.TestConstants.USER_TOKENS_API_SCENARIO
|
||||
import com.tangem.common.extensions.SwipeDirection
|
||||
import com.tangem.common.extensions.clickWithAssertion
|
||||
import com.tangem.common.extensions.swipeVertical
|
||||
import com.tangem.common.utils.resetWireMockScenarioState
|
||||
import com.tangem.scenarios.checkSendWarning
|
||||
import com.tangem.scenarios.openSendScreen
|
||||
import com.tangem.screens.onSendAddressScreen
|
||||
import com.tangem.screens.onSendConfirmScreen
|
||||
import com.tangem.screens.onSendScreen
|
||||
import com.tangem.wallet.R
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
import io.qameta.allure.kotlin.junit4.DisplayName
|
||||
import org.junit.Test
|
||||
|
||||
@HiltAndroidTest
|
||||
class TezosWarningsTest : BaseTestCase() {
|
||||
private val tokenName = "Tezos"
|
||||
private val reduceAmount = "0.000001"
|
||||
private val sendAmount = "0.01"
|
||||
|
||||
private val feeIsHighTitleResId = R.string.send_notification_high_fee_title
|
||||
private val feeIsHighMessageResId = R.string.send_notification_high_fee_text
|
||||
|
||||
@AllureId("4229")
|
||||
@DisplayName("Warnings: warning is displayed when sending max amount")
|
||||
@Test
|
||||
fun warningIsDisplayedWhenSendMaxAmount() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Click 'Max amount' button") {
|
||||
onSendScreen {
|
||||
maxButton.clickWithAssertion()
|
||||
}
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Type address in input text field") {
|
||||
onSendAddressScreen { addressTextField.performTextReplacement(TEZOS_RECIPIENT_ADDRESS) }
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendAddressScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Swipe up to see the warning"){
|
||||
swipeVertical(SwipeDirection.UP)
|
||||
}
|
||||
step("Assert 'Fee is high warning' is displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = feeIsHighTitleResId,
|
||||
messageResId = feeIsHighMessageResId,
|
||||
amount = reduceAmount,
|
||||
sendButtonIsDisabled = false
|
||||
)
|
||||
}
|
||||
step("Click on 'Reduce' button") {
|
||||
onSendConfirmScreen { reduceAmountButton(reduceAmount).clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Fee is high warning' is not displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = feeIsHighTitleResId,
|
||||
messageResId = feeIsHighMessageResId,
|
||||
amount = reduceAmount,
|
||||
isDisplayed = false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@AllureId("4230")
|
||||
@DisplayName("Warnings: warning is not displayed when sending not max amount")
|
||||
@Test
|
||||
fun warningIsNotDisplayedWhenSendNotMaxAmount() {
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
resetWireMockScenarioState(USER_TOKENS_API_SCENARIO)
|
||||
resetWireMockScenarioState(QUOTES_API_SCENARIO)
|
||||
}
|
||||
).run {
|
||||
step("Open 'Send Screen' with token: $tokenName") {
|
||||
openSendScreen(tokenName)
|
||||
}
|
||||
step("Type '$sendAmount' in input text field") {
|
||||
onSendScreen {
|
||||
amountInputTextField.performClick()
|
||||
amountInputTextField.performTextReplacement(sendAmount)
|
||||
}
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Type address in input text field") {
|
||||
onSendAddressScreen { addressTextField.performTextReplacement(TEZOS_RECIPIENT_ADDRESS) }
|
||||
}
|
||||
step("Click on 'Next' button") {
|
||||
onSendAddressScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Assert 'Fee is high warning' is not displayed") {
|
||||
checkSendWarning(
|
||||
titleResId = feeIsHighTitleResId,
|
||||
messageResId = feeIsHighMessageResId,
|
||||
amount = reduceAmount,
|
||||
isDisplayed = false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -250,6 +250,13 @@ object WalletMockContent : MockContent {
|
|||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
DerivationPath("m/44'/1729'/0'/0'") to ExtendedPublicKey( // Tezos
|
||||
publicKey = byteArrayOf(2, -40, 115, -15, 80, 104, 100, -29, 80, 29, 112, -35, -54, 64, -98, 45, 115, 108, 93, 113, -71, 89, 17, 72, 98, 21, 126, 82, -50, 50, -12, -87, -62),
|
||||
chainCode = byteArrayOf(-27, 56, 57, 54, 27, -40, 65, 109, 119, -54, -94, 88, -29, -115, -45, -112, -31, 57, 53, 56, 118, 87, 34, -16, -64, -45, 105, 77, 91, -106, -92, 41),
|
||||
depth = 0,
|
||||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
ByteArrayKey(
|
||||
|
|
@ -279,6 +286,27 @@ object WalletMockContent : MockContent {
|
|||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
DerivationPath("m/44'/354'/0'/0'/0'") to ExtendedPublicKey( // Polkadot
|
||||
publicKey = byteArrayOf(2, 34, 6, 119, -106, 5, -119, 111, -22, 8, 23, -108, -72, -56, 6, 77, -17, -61, -101, -85, 16, 28, 18, 3, -3, -89, -81, -108, 48, -7, -86, -82),
|
||||
chainCode = byteArrayOf(-75, 55, 107, -106, -37, -81, -15, 72, -102, 94, 55, -39, 9, -112, 1, 90, -50, 103, 53, 120, -92, -36, -85, -39, -65, 1, 88, 46, 92, 104, -13, -109),
|
||||
depth = 0,
|
||||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
DerivationPath("m/44'/434'/0'/0'/0'") to ExtendedPublicKey( // Kusama
|
||||
publicKey = byteArrayOf(2, 34, 6, 119, -106, 5, -119, 111, -22, 8, 23, -108, -72, -56, 6, 77, -17, -61, -101, -85, 16, 28, 18, 3, -3, -89, -81, -108, 48, -7, -86, -82),
|
||||
chainCode = byteArrayOf(-75, 55, 107, -106, -37, -81, -15, 72, -102, 94, 55, -39, 9, -112, 1, 90, -50, 103, 53, 120, -92, -36, -85, -39, -65, 1, 88, 46, 92, 104, -13, -109),
|
||||
depth = 0,
|
||||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
DerivationPath("m/44'/643'/0'/0'/0'") to ExtendedPublicKey( // Azero
|
||||
publicKey = byteArrayOf(2, 34, 6, 119, -106, 5, -119, 111, -22, 8, 23, -108, -72, -56, 6, 77, -17, -61, -101, -85, 16, 28, 18, 3, -3, -89, -81, -108, 48, -7, -86, -82),
|
||||
chainCode = byteArrayOf(-75, 55, 107, -106, -37, -81, -15, 72, -102, 94, 55, -39, 9, -112, 1, 90, -50, 103, 53, 120, -92, -36, -85, -39, -65, 1, 88, 46, 92, 104, -13, -109),
|
||||
depth = 0,
|
||||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
|
@ -318,6 +346,13 @@ object WalletMockContent : MockContent {
|
|||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
DerivationPath("m/44'/1729'/0'/0'") to ExtendedPublicKey( // Tezos
|
||||
publicKey = byteArrayOf(2, -40, 115, -15, 80, 104, 100, -29, 80, 29, 112, -35, -54, 64, -98, 45, 115, 108, 93, 113, -71, 89, 17, 72, 98, 21, 126, 82, -50, 50, -12, -87, -62),
|
||||
chainCode = byteArrayOf(-27, 56, 57, 54, 27, -40, 65, 109, 119, -54, -94, 88, -29, -115, -45, -112, -31, 57, 53, 56, 118, 87, 34, -16, -64, -45, 105, 77, 91, -106, -92, 41),
|
||||
depth = 0,
|
||||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
ByteArrayKey(
|
||||
|
|
@ -347,6 +382,27 @@ object WalletMockContent : MockContent {
|
|||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
DerivationPath("m/44'/354'/0'/0'/0'") to ExtendedPublicKey( // Polkadot
|
||||
publicKey = byteArrayOf(2, -40, 115, -15, 80, 104, 100, -29, 80, 29, 112, -35, -54, 64, -98, 45, 115, 108, 93, 113, -71, 89, 17, 72, 98, 21, 126, 82, -50, 50, -12, -87, -62),
|
||||
chainCode = byteArrayOf(-27, 56, 57, 54, 27, -40, 65, 109, 119, -54, -94, 88, -29, -115, -45, -112, -31, 57, 53, 56, 118, 87, 34, -16, -64, -45, 105, 77, 91, -106, -92, 41),
|
||||
depth = 0,
|
||||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
DerivationPath("m/44'/434'/0'/0'/0'") to ExtendedPublicKey( // Kusama
|
||||
publicKey = byteArrayOf(2, -40, 115, -15, 80, 104, 100, -29, 80, 29, 112, -35, -54, 64, -98, 45, 115, 108, 93, 113, -71, 89, 17, 72, 98, 21, 126, 82, -50, 50, -12, -87, -62),
|
||||
chainCode = byteArrayOf(-27, 56, 57, 54, 27, -40, 65, 109, 119, -54, -94, 88, -29, -115, -45, -112, -31, 57, 53, 56, 118, 87, 34, -16, -64, -45, 105, 77, 91, -106, -92, 41),
|
||||
depth = 0,
|
||||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
DerivationPath("m/44'/643'/0'/0'/0'") to ExtendedPublicKey( // Azero
|
||||
publicKey = byteArrayOf(2, -40, 115, -15, 80, 104, 100, -29, 80, 29, 112, -35, -54, 64, -98, 45, 115, 108, 93, 113, -71, 89, 17, 72, 98, 21, 126, 82, -50, 50, -12, -87, -62),
|
||||
chainCode = byteArrayOf(-27, 56, 57, 54, 27, -40, 65, 109, 119, -54, -94, 88, -29, -115, -45, -112, -31, 57, 53, 56, 118, 87, 34, -16, -64, -45, 105, 77, 91, -106, -92, 41),
|
||||
depth = 0,
|
||||
parentFingerprint = byteArrayOf(0, 0, 0, 0),
|
||||
childNumber = 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue