Updated on 2026-08-14
This commit is contained in:
parent
6cfb8213f0
commit
0858748471
7 changed files with 14 additions and 64 deletions
|
|
@ -5,7 +5,6 @@ import com.tangem.common.BaseTestCase
|
|||
import com.tangem.common.extensions.clickWithAssertion
|
||||
import com.tangem.domain.models.scan.ProductType
|
||||
import com.tangem.screens.*
|
||||
import com.tangem.screens.AlreadyUsedWalletDialogPageObject.thisIsMyWalletButton
|
||||
import com.tangem.tap.domain.sdk.mocks.MockContent
|
||||
import com.tangem.tap.domain.sdk.mocks.MockProvider
|
||||
import com.tangem.utils.StringsSigns.DASH_SIGN
|
||||
|
|
@ -14,7 +13,6 @@ import io.qameta.allure.kotlin.Allure.step
|
|||
fun BaseTestCase.scanCard(
|
||||
productType: ProductType? = null,
|
||||
mockContent: MockContent? = null,
|
||||
alreadyActivatedDialogIsShown: Boolean = false,
|
||||
isTwinsCard: Boolean = false,
|
||||
) {
|
||||
if (productType != null) {
|
||||
|
|
@ -32,12 +30,6 @@ fun BaseTestCase.scanCard(
|
|||
step("Click on 'Scan card or ring' button") {
|
||||
onCreateWalletStartScreen { scanCardOrRingButton.clickWithAssertion() }
|
||||
}
|
||||
if (alreadyActivatedDialogIsShown) {
|
||||
step("Click on 'This is my wallet' button") {
|
||||
waitForIdle()
|
||||
AlreadyUsedWalletDialogPageObject { thisIsMyWalletButton.click() }
|
||||
}
|
||||
}
|
||||
if (isTwinsCard) {
|
||||
step("Click on 'Continue' button") {
|
||||
onOnboardingScreen { continueButton.clickWithAssertion() }
|
||||
|
|
@ -51,14 +43,12 @@ fun BaseTestCase.scanCard(
|
|||
fun BaseTestCase.openMainScreen(
|
||||
productType: ProductType? = null,
|
||||
mockContent: MockContent? = null,
|
||||
alreadyActivatedDialogIsShown: Boolean = false,
|
||||
isTwinsCard: Boolean = false,
|
||||
) {
|
||||
step("Scan card") {
|
||||
scanCard(
|
||||
productType = productType,
|
||||
mockContent = mockContent,
|
||||
alreadyActivatedDialogIsShown = alreadyActivatedDialogIsShown,
|
||||
isTwinsCard = isTwinsCard,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class DetailsTest : BaseTestCase() {
|
|||
fun wallet2DetailsTest() =
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen(productType = ProductType.Wallet2, alreadyActivatedDialogIsShown = true)
|
||||
openMainScreen(productType = ProductType.Wallet2)
|
||||
}
|
||||
onTopBar {
|
||||
step("Open wallet details") {
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@ import com.tangem.common.constants.TestConstants.RECIPIENT_ADDRESS
|
|||
import com.tangem.common.constants.TestConstants.WAIT_UNTIL_TIMEOUT
|
||||
import com.tangem.common.core.TangemSdkError
|
||||
import com.tangem.common.extensions.clickWithAssertion
|
||||
import com.tangem.domain.models.scan.ProductType
|
||||
import com.tangem.domain.redux.StateDialog
|
||||
import com.tangem.scenarios.*
|
||||
import com.tangem.scenarios.checkFailedTransactionDialog
|
||||
import com.tangem.scenarios.checkScanWarningDialog
|
||||
import com.tangem.scenarios.openMainScreen
|
||||
import com.tangem.scenarios.synchronizeAddresses
|
||||
import com.tangem.screens.*
|
||||
import com.tangem.screens.AlreadyUsedWalletDialogPageObject.requestSupportButton
|
||||
import com.tangem.tap.common.redux.global.GlobalAction
|
||||
import com.tangem.tap.domain.sdk.mocks.MockProvider
|
||||
import com.tangem.tap.store
|
||||
|
|
@ -96,7 +97,7 @@ class FeedbackTest : BaseTestCase() {
|
|||
step("Click 'Next' button") {
|
||||
onSendAddressScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Assert sanding text is displayed") {
|
||||
step("Assert sеnding text is displayed") {
|
||||
onSendConfirmScreen { sendingText.assertIsDisplayed() }
|
||||
}
|
||||
step("Click 'Send' button") {
|
||||
|
|
@ -163,39 +164,4 @@ class FeedbackTest : BaseTestCase() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@AllureId("3986")
|
||||
@DisplayName("Send feedback: from scan already used wallet alert dialog")
|
||||
@Test
|
||||
fun sendFeedbackAfterScanAlreadyUsedWalletTest() {
|
||||
val gmailText = "Welcome to Gmail"
|
||||
|
||||
setupHooks(
|
||||
additionalAfterSection = {
|
||||
device.uiDevice.pressBack()
|
||||
}
|
||||
).run {
|
||||
step("Set mocks for Wallet2") {
|
||||
MockProvider.setMocks(ProductType.Wallet2)
|
||||
}
|
||||
step("Click on 'Accept' button") {
|
||||
onDisclaimerScreen { acceptButton.clickWithAssertion() }
|
||||
}
|
||||
step("Click on 'Get started' button") {
|
||||
onStoriesScreen { getStartedButton.clickWithAssertion() }
|
||||
}
|
||||
step("Click on 'Scan card or ring' button") {
|
||||
onCreateWalletStartScreen { scanCardOrRingButton.clickWithAssertion() }
|
||||
}
|
||||
step("Check 'Already used Wallet' dialog") {
|
||||
checkAlreadyUsedWalletDialog()
|
||||
}
|
||||
step("Click on 'Request support' button") {
|
||||
AlreadyUsedWalletDialogPageObject { requestSupportButton.click() }
|
||||
}
|
||||
step("Assert 'Gmail' app is open") {
|
||||
ThirdPartyAppPageObject { assertElementWithTextExists(gmailText) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -30,10 +30,7 @@ class OnboardingTest : BaseTestCase() {
|
|||
@Test
|
||||
fun shibaBackupScreenTest() {
|
||||
setupHooks().run {
|
||||
scanCard(
|
||||
mockContent = ShibaNoBackupMockContent,
|
||||
alreadyActivatedDialogIsShown = true
|
||||
)
|
||||
scanCard(mockContent = ShibaNoBackupMockContent)
|
||||
checkBackupScreen()
|
||||
}
|
||||
}
|
||||
|
|
@ -54,10 +51,7 @@ class OnboardingTest : BaseTestCase() {
|
|||
@Test
|
||||
fun wallet2BackupScreenTest() {
|
||||
setupHooks().run {
|
||||
scanCard(
|
||||
mockContent = Wallet2NoBackupMockContent,
|
||||
alreadyActivatedDialogIsShown = true
|
||||
)
|
||||
scanCard(mockContent = Wallet2NoBackupMockContent)
|
||||
checkBackupScreen()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class ResetCardTest : BaseTestCase() {
|
|||
fun resetWallet2CardWithBackupTest() {
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen'") {
|
||||
openMainScreen(productType = ProductType.Wallet2, alreadyActivatedDialogIsShown = true)
|
||||
openMainScreen(productType = ProductType.Wallet2)
|
||||
}
|
||||
step("Open 'Device settings' screen") {
|
||||
openDeviceSettingsScreen()
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class ScanCardTest : BaseTestCase() {
|
|||
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen' on $card") {
|
||||
openMainScreen(mockContent = cardType, alreadyActivatedDialogIsShown = true)
|
||||
openMainScreen(mockContent = cardType)
|
||||
}
|
||||
step("Check 'Main' screen for $card curve with devices count = '$devicesCount'") {
|
||||
checkMultiCurrencyMainScreen(
|
||||
|
|
@ -119,7 +119,7 @@ class ScanCardTest : BaseTestCase() {
|
|||
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen' on '$card' card") {
|
||||
openMainScreen(mockContent = cardType, alreadyActivatedDialogIsShown = true)
|
||||
openMainScreen(mockContent = cardType)
|
||||
}
|
||||
step("Check 'Main' screen for '$card' card with devices count = '$devicesCount'") {
|
||||
checkMultiCurrencyMainScreen(devicesCount, cardName)
|
||||
|
|
@ -138,7 +138,7 @@ class ScanCardTest : BaseTestCase() {
|
|||
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen' on '$ring'") {
|
||||
openMainScreen(productType = cardType, alreadyActivatedDialogIsShown = true)
|
||||
openMainScreen(productType = cardType)
|
||||
}
|
||||
step("Check 'Main' screen for '$ring' with devices count = '$devicesCount'") {
|
||||
checkMultiCurrencyMainScreen(devicesCount, cardName)
|
||||
|
|
@ -175,7 +175,7 @@ class ScanCardTest : BaseTestCase() {
|
|||
|
||||
setupHooks().run {
|
||||
step("Open 'Main Screen' on '$card' card") {
|
||||
openMainScreen(mockContent = cardType, alreadyActivatedDialogIsShown = true)
|
||||
openMainScreen(mockContent = cardType)
|
||||
}
|
||||
step("Check 'Main' screen for '$card' card with devices count = '$devicesCount'") {
|
||||
checkMultiCurrencyMainScreen(devicesCount, cardName)
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class WarningTest : BaseTestCase() {
|
|||
}
|
||||
).run {
|
||||
step("Open 'Main' screen") {
|
||||
openMainScreen(mockContent = Wallet2WithSeedPhraseMockContent, alreadyActivatedDialogIsShown = true)
|
||||
openMainScreen(mockContent = Wallet2WithSeedPhraseMockContent)
|
||||
}
|
||||
step("Assert 'Seed phrase' notification icon is displayed") {
|
||||
onMainScreen { seedPhraseNotificationIcon.assertIsDisplayed() }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue