Updated on 2026-08-14
This commit is contained in:
parent
a252e33515
commit
a5a8cee12c
12 changed files with 436 additions and 24 deletions
|
|
@ -0,0 +1,7 @@
|
|||
package com.tangem.common.extensions
|
||||
|
||||
import io.github.kakaocup.kakao.common.views.KBaseView
|
||||
|
||||
fun <T : KBaseView<*>> T.withDialogRoot(): T {
|
||||
return this.also { inRoot { isDialog() } }
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ 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 io.qameta.allure.kotlin.Allure.step
|
||||
|
|
@ -27,6 +28,7 @@ fun BaseTestCase.openMainScreen(
|
|||
}
|
||||
if (alreadyActivatedDialogIsShown) {
|
||||
step("Click on 'This is my wallet' button") {
|
||||
composeTestRule.waitForIdle()
|
||||
AlreadyUsedWalletDialogPageObject { thisIsMyWalletButton.click() }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,19 @@ package com.tangem.scenarios
|
|||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.screens.AlreadyUsedWalletDialogPageObject
|
||||
import com.tangem.screens.AlreadyUsedWalletDialogPageObject.cancelButton
|
||||
import com.tangem.screens.AlreadyUsedWalletDialogPageObject.message
|
||||
import com.tangem.screens.AlreadyUsedWalletDialogPageObject.requestSupportButton
|
||||
import com.tangem.screens.AlreadyUsedWalletDialogPageObject.thisIsMyWalletButton
|
||||
import com.tangem.screens.AlreadyUsedWalletDialogPageObject.title
|
||||
import com.tangem.screens.ScanWarningDialogPageObject
|
||||
import com.tangem.screens.onFailedTransactionDialog
|
||||
import io.qameta.allure.kotlin.Allure.step
|
||||
|
||||
fun BaseTestCase.checkFailedTransactionDialog() {
|
||||
step("Assert failed transaction dialog is displayed") {
|
||||
onFailedTransactionDialog { dialogContainer.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert failed transaction dialog title is displayed") {
|
||||
onFailedTransactionDialog { title.assertIsDisplayed() }
|
||||
}
|
||||
|
|
@ -47,7 +55,7 @@ fun checkAlreadyUsedWalletDialog() {
|
|||
AlreadyUsedWalletDialogPageObject { message.isDisplayed() }
|
||||
}
|
||||
step("Assert 'This is my wallet' button is displayed") {
|
||||
AlreadyUsedWalletDialogPageObject { message.isDisplayed() }
|
||||
AlreadyUsedWalletDialogPageObject { thisIsMyWalletButton.isDisplayed() }
|
||||
}
|
||||
step("Assert 'Cancel' button is displayed") {
|
||||
AlreadyUsedWalletDialogPageObject { cancelButton.isDisplayed() }
|
||||
|
|
|
|||
|
|
@ -1,32 +1,29 @@
|
|||
package com.tangem.screens
|
||||
|
||||
import com.kaspersky.kaspresso.screens.KScreen
|
||||
import com.tangem.common.extensions.withDialogRoot
|
||||
import com.tangem.wallet.R
|
||||
import io.github.kakaocup.kakao.text.KTextView
|
||||
import io.github.kakaocup.kakao.text.KButton
|
||||
import io.github.kakaocup.kakao.text.KTextView
|
||||
|
||||
object AlreadyUsedWalletDialogPageObject : KScreen<AlreadyUsedWalletDialogPageObject>() {
|
||||
|
||||
override val layoutId: Int? = null
|
||||
override val viewClass: Class<*>? = null
|
||||
object AlreadyUsedWalletDialogPageObject : BaseDialog() {
|
||||
|
||||
val title = KTextView {
|
||||
withText(R.string.security_alert_title)
|
||||
}
|
||||
}.withDialogRoot()
|
||||
|
||||
val message = KTextView {
|
||||
withText(R.string.wallet_been_activated_message)
|
||||
}
|
||||
}.withDialogRoot()
|
||||
|
||||
val cancelButton = KButton {
|
||||
withText(R.string.common_cancel)
|
||||
}
|
||||
}.withDialogRoot()
|
||||
|
||||
val requestSupportButton = KButton {
|
||||
withText(R.string.alert_button_request_support)
|
||||
}
|
||||
}.withDialogRoot()
|
||||
|
||||
val thisIsMyWalletButton = KButton {
|
||||
withText(R.string.this_is_my_wallet_title)
|
||||
}
|
||||
}.withDialogRoot()
|
||||
}
|
||||
14
app/src/androidTest/kotlin/com/tangem/screens/BaseDialog.kt
Normal file
14
app/src/androidTest/kotlin/com/tangem/screens/BaseDialog.kt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package com.tangem.screens
|
||||
|
||||
import io.github.kakaocup.kakao.common.views.KBaseView
|
||||
|
||||
abstract class BaseDialog : KBaseView<BaseDialog>({ isRoot() }) {
|
||||
|
||||
init {
|
||||
setDialogRoot()
|
||||
}
|
||||
|
||||
private fun setDialogRoot() {
|
||||
inRoot { isDialog() }
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,10 @@ import androidx.compose.ui.test.hasAnyAncestor
|
|||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.extensions.hasLazyListItemPosition
|
||||
import com.tangem.common.utils.LazyListItemNode
|
||||
import com.tangem.core.ui.test.BaseButtonTestTags
|
||||
import com.tangem.core.ui.test.MainScreenTestTags
|
||||
import com.tangem.core.ui.test.TokenElementsTestTags
|
||||
import com.tangem.core.ui.test.NotificationTestTags
|
||||
import com.tangem.core.ui.test.TokenElementsTestTags
|
||||
import com.tangem.core.ui.utils.LazyListItemPositionSemantics
|
||||
import com.tangem.feature.wallet.impl.R
|
||||
import io.github.kakaocup.compose.node.element.ComposeScreen
|
||||
|
|
@ -73,6 +74,24 @@ class MainScreenPageObject(semanticsProvider: SemanticsNodeInteractionsProvider)
|
|||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
val seedPhraseNotificationIcon: KNode = child {
|
||||
hasAnySibling(withText(getResourceString(R.string.warning_seedphrase_issue_title)))
|
||||
hasTestTag(NotificationTestTags.ICON)
|
||||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
val seedPhraseNotificationTitle: KNode = child {
|
||||
hasTestTag(NotificationTestTags.TITLE)
|
||||
hasText(getResourceString(R.string.warning_seedphrase_issue_title))
|
||||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
val seedPhraseNotificationMessage: KNode = child {
|
||||
hasTestTag(NotificationTestTags.MESSAGE)
|
||||
hasText(getResourceString(R.string.warning_seedphrase_issue_message))
|
||||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
val totalBalanceContainer: KNode = child {
|
||||
hasTestTag(MainScreenTestTags.WALLET_LIST_ITEM)
|
||||
}
|
||||
|
|
@ -91,6 +110,18 @@ class MainScreenPageObject(semanticsProvider: SemanticsNodeInteractionsProvider)
|
|||
hasParent(withTestTag(MainScreenTestTags.WALLET_BALANCE))
|
||||
}
|
||||
|
||||
val notificationYesButton: KNode = child {
|
||||
hasTestTag(BaseButtonTestTags.TEXT)
|
||||
hasText(getResourceString(R.string.common_yes))
|
||||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
val notificationNoButton: KNode = child {
|
||||
hasTestTag(BaseButtonTestTags.TEXT)
|
||||
hasText(getResourceString(R.string.common_no))
|
||||
useUnmergedTree = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Find token list item with title and address
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,12 +4,14 @@ import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiT
|
|||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.constants.TestConstants.RECIPIENT_ADDRESS
|
||||
import com.tangem.common.constants.TestConstants.TOTAL_BALANCE
|
||||
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.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
|
||||
|
|
@ -17,7 +19,6 @@ import dagger.hilt.android.testing.HiltAndroidTest
|
|||
import io.qameta.allure.kotlin.Allure
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
import io.qameta.allure.kotlin.junit4.DisplayName
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
|
||||
@HiltAndroidTest
|
||||
|
|
@ -92,10 +93,15 @@ class FeedbackTest : BaseTestCase() {
|
|||
onSendAddressScreen { nextButton.clickWithAssertion() }
|
||||
}
|
||||
step("Click 'Send' button") {
|
||||
onSendConfirmScreen { sendButton.clickWithAssertion() }
|
||||
onSendConfirmScreen {
|
||||
sendButton.assertIsEnabled()
|
||||
sendButton.performClick()
|
||||
}
|
||||
}
|
||||
step("Check 'Failed transaction' dialog") {
|
||||
checkFailedTransactionDialog()
|
||||
flakySafely(WAIT_UNTIL_TIMEOUT) {
|
||||
checkFailedTransactionDialog()
|
||||
}
|
||||
}
|
||||
step("Click on 'Support' button") {
|
||||
onFailedTransactionDialog { supportButton.performClick() }
|
||||
|
|
@ -145,7 +151,6 @@ class FeedbackTest : BaseTestCase() {
|
|||
|
||||
@AllureId("3986")
|
||||
@DisplayName("Send feedback: from scan already used wallet alert dialog")
|
||||
@Ignore("TODO On CI Already used wallet doesn't displayed")
|
||||
@Test
|
||||
fun sendFeedbackAfterScanAlreadyUsedWalletTest() {
|
||||
setupHooks(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import com.tangem.tap.domain.sdk.mocks.content.BackupWalletMockContent
|
|||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
import io.qameta.allure.kotlin.junit4.DisplayName
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
|
||||
@HiltAndroidTest
|
||||
|
|
@ -61,7 +60,6 @@ class ResetCardTest : BaseTestCase() {
|
|||
|
||||
@AllureId("3974")
|
||||
@DisplayName("Reset card: reset Wallet 2.0 card with backup")
|
||||
@Ignore("toDo [REDACTED_TASK_KEY]: On CI Already used wallet dialog doesn't displayed")
|
||||
@Test
|
||||
fun resetWallet2CardWithBackupTest() {
|
||||
setupHooks().run {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import org.junit.Test
|
|||
@HiltAndroidTest
|
||||
class WalletConnectTest : BaseTestCase() {
|
||||
|
||||
@AllureId("3833")
|
||||
@AllureId("3958")
|
||||
@DisplayName("WC (React App): open session from deeplink on main screen")
|
||||
@Ignore("TODO [REDACTED_JIRA] React app deeplink doesn't work")
|
||||
@Test
|
||||
|
|
@ -65,7 +65,7 @@ class WalletConnectTest : BaseTestCase() {
|
|||
}
|
||||
}
|
||||
|
||||
@AllureId("3834")
|
||||
@AllureId("3959")
|
||||
@DisplayName("WC (React App): open session from deeplink not on main screen")
|
||||
@Ignore("TODO [REDACTED_JIRA] React app deeplink doesn't work")
|
||||
@Test
|
||||
|
|
@ -120,7 +120,7 @@ class WalletConnectTest : BaseTestCase() {
|
|||
}
|
||||
}
|
||||
|
||||
@AllureId("886")
|
||||
@AllureId("3957")
|
||||
@DisplayName("WC (React App): open session from deeplink ")
|
||||
@Ignore("TODO [REDACTED_JIRA] React app deeplink doesn't work")
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
package com.tangem.tests
|
||||
|
||||
import com.tangem.common.BaseTestCase
|
||||
import com.tangem.common.utils.resetWireMockScenarioState
|
||||
import com.tangem.common.utils.setWireMockScenarioState
|
||||
import com.tangem.scenarios.openMainScreen
|
||||
import com.tangem.screens.onMainScreen
|
||||
import com.tangem.tap.domain.sdk.mocks.content.DevWalletMockContent
|
||||
import com.tangem.tap.domain.sdk.mocks.content.Wallet2WithSeedPhraseMockContent
|
||||
import dagger.hilt.android.testing.HiltAndroidTest
|
||||
import io.qameta.allure.kotlin.Allure.step
|
||||
import io.qameta.allure.kotlin.AllureId
|
||||
import io.qameta.allure.kotlin.junit4.DisplayName
|
||||
import org.junit.Test
|
||||
|
|
@ -51,4 +55,43 @@ class WarningTest : BaseTestCase() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@AllureId("227")
|
||||
@DisplayName("Seed notify: check warning for wallet with seed phrase")
|
||||
@Test
|
||||
fun checkWarningForWalletWithSeedPhraseTest() {
|
||||
val scenarioName = "seedphrase_notification"
|
||||
val scenarioState = "Notified"
|
||||
setupHooks(
|
||||
additionalBeforeSection = {
|
||||
step("Setup WireMock scenario '$scenarioName' for '$scenarioState' state") {
|
||||
setWireMockScenarioState(scenarioName, scenarioState)
|
||||
}
|
||||
},
|
||||
additionalAfterSection = {
|
||||
step("Reset WireMock scenario '$scenarioName' state") {
|
||||
resetWireMockScenarioState(scenarioName)
|
||||
}
|
||||
}
|
||||
).run {
|
||||
step("Open 'Main' screen") {
|
||||
openMainScreen(mockContent = Wallet2WithSeedPhraseMockContent, alreadyActivatedDialogIsShown = true)
|
||||
}
|
||||
step("Assert 'Seed phrase' notification icon is displayed") {
|
||||
onMainScreen { seedPhraseNotificationIcon.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert 'Seed phrase' notification title is displayed") {
|
||||
onMainScreen { seedPhraseNotificationTitle.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert 'Seed phrase' notification message is displayed") {
|
||||
onMainScreen { seedPhraseNotificationMessage.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert notification 'Yes' button is displayed") {
|
||||
onMainScreen { notificationYesButton.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert notification 'No' button is displayed") {
|
||||
onMainScreen { notificationNoButton.assertIsDisplayed() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue