Updated on 2026-08-14

This commit is contained in:
Tangem 2025-09-02 17:33:18 +03:00
parent 498e62329a
commit 02f927fd48
18 changed files with 898 additions and 29 deletions

View file

@ -126,6 +126,10 @@ abstract class BaseTestCase : TestCase(
with(featureTogglesManager as MutableFeatureTogglesManager) {
changeToggle("WALLET_CONNECT_REDESIGN_ENABLED", true)
changeToggle("WALLET_BALANCE_FETCHER_ENABLED", true)
changeToggle("SEND_VIA_SWAP_ENABLED", true)
changeToggle("SWAP_REDESIGN_ENABLED", true)
changeToggle("SEND_REDESIGN_ENABLED", true)
changeToggle("NEW_ONRAMP_MAIN_ENABLED", true)
}
}
}

View file

@ -0,0 +1,105 @@
package com.tangem.common.utils
import okhttp3.OkHttpClient
import okhttp3.Request
import org.json.JSONObject
import timber.log.Timber
import java.util.concurrent.TimeUnit
/**
*
*/
fun getWcUri(
network: String = "ethereum",
baseUrl: String = "[REDACTED_ENV_URL]"
): String? {
Timber.i("Getting WC URI for network: $network")
val client = OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS) // Таймаут подключения
.readTimeout(60, TimeUnit.SECONDS) // Таймаут чтения ответа
.writeTimeout(30, TimeUnit.SECONDS) // Таймаут записи
.callTimeout(90, TimeUnit.SECONDS) // Общий таймаут запроса
.build()
val request = Request.Builder()
.url("$baseUrl/wc_uri?network=$network")
.get()
.build()
return try {
client.newCall(request).execute().use { response ->
Timber.i("Response code: ${response.code}")
if (response.isSuccessful) {
val body = response.body?.string() ?: ""
Timber.i("Response body: $body")
val jsonObject = JSONObject(body)
if (jsonObject.getBoolean("success")) {
val wcUri = jsonObject.getString("wcUri")
Timber.i("Got WC URI successfully: $wcUri")
wcUri
} else {
Timber.e("API returned error: ${jsonObject.optString("error", "Unknown")}")
null
}
} else {
val errorBody = response.body?.string() ?: "No error body"
Timber.e("Request failed: ${response.code}, body: $errorBody")
null
}
}
} catch (e: Exception) {
Timber.e(e, "Error getting WC URI")
null
}
}
fun checkServiceHealth(
baseUrl: String = "[REDACTED_ENV_URL]"
): String? {
Timber.i("Checking service health")
val client = OkHttpClient()
val request = Request.Builder()
.url("$baseUrl/health")
.get()
.build()
return try {
client.newCall(request).execute().use { response ->
Timber.i("Response code: ${response.code}")
if (response.isSuccessful) {
val body = response.body?.string() ?: ""
Timber.i("Response body: $body")
if (body.isEmpty()) {
Timber.e("Response body is empty")
return null
}
val jsonObject = JSONObject(body)
val status = jsonObject.optString("status", "")
if (status.isNotEmpty()) {
Timber.i("Got status successfully: $status")
status
} else {
Timber.e("Status field is missing or empty")
null
}
} else {
val errorBody = response.body?.string() ?: "No error body"
Timber.e("Request failed: ${response.code}, body: $errorBody")
null
}
}
} catch (e: Exception) {
Timber.e(e, "Error checking health")
null
}
}

View file

@ -35,6 +35,10 @@ class MainScreenPageObject(semanticsProvider: SemanticsNodeInteractionsProvider)
}
)
val screenContainer: KNode = child {
hasTestTag(MainScreenTestTags.SCREEN_CONTAINER)
}
val synchronizeAddressesButton: KNode = child {
hasText(getResourceString(R.string.common_generate_addresses))
}

View file

@ -0,0 +1,108 @@
package com.tangem.screens
import androidx.compose.ui.test.SemanticsNodeInteractionsProvider
import com.tangem.common.BaseTestCase
import com.tangem.core.ui.R
import com.tangem.core.ui.test.BaseButtonTestTags
import com.tangem.core.ui.test.WalletConnectBottomSheetTestTags
import io.github.kakaocup.compose.node.element.ComposeScreen
import io.github.kakaocup.compose.node.element.ComposeScreen.Companion.onComposeScreen
import io.github.kakaocup.compose.node.element.KNode
import io.github.kakaocup.kakao.common.utilities.getResourceString
import com.tangem.features.walletconnect.impl.R as WalletConnectImplR
class WalletConnectBottomSheetPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) :
ComposeScreen<WalletConnectBottomSheetPageObject>(semanticsProvider = semanticsProvider) {
val title: KNode = child {
hasText(getResourceString(WalletConnectImplR.string.wc_wallet_connect))
hasTestTag(WalletConnectBottomSheetTestTags.TITLE)
useUnmergedTree = true
}
val appIcon: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.APP_ICON)
useUnmergedTree = true
}
val appName: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.APP_NAME)
useUnmergedTree = true
}
val approveIcon: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.APPROVE_ICON)
useUnmergedTree = true
}
val appUrl: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.APP_URL)
useUnmergedTree = true
}
val connectionRequestIcon: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.CONNECTION_REQUEST_ICON)
useUnmergedTree = true
}
val connectionRequestText: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.CONNECTION_REQUEST_TEXT)
useUnmergedTree = true
}
val connectionRequestChevron: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.CONNECTION_REQUEST_CHEVRON)
useUnmergedTree = true
}
val walletIcon: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.WALLET_ICON)
useUnmergedTree = true
}
val walletNameTitle: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.WALLET_NAME_TITLE)
useUnmergedTree = true
}
val walletName: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.WALLET_NAME)
useUnmergedTree = true
}
val networksIcon: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.NETWORKS_ICON)
useUnmergedTree = true
}
val networksTitle: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.NETWORKS_TITLE)
useUnmergedTree = true
}
val networksIcons: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.NETWORKS_ICONS)
useUnmergedTree = true
}
val networksSelectorIcon: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.NETWORKS_SELECTOR_ICON)
useUnmergedTree = true
}
val cancelButton: KNode = child {
hasText(getResourceString(R.string.common_cancel))
hasTestTag(BaseButtonTestTags.TEXT)
useUnmergedTree = true
}
val connectButton: KNode = child {
hasText(getResourceString(R.string.wc_common_connect))
hasTestTag(BaseButtonTestTags.TEXT)
useUnmergedTree = true
}
}
internal fun BaseTestCase.onWalletConnectBottomSheet(function: WalletConnectBottomSheetPageObject.() -> Unit) =
onComposeScreen(composeTestRule, function)

View file

@ -0,0 +1,107 @@
package com.tangem.screens
import androidx.compose.ui.test.SemanticsNodeInteractionsProvider
import com.tangem.common.BaseTestCase
import com.tangem.core.ui.test.BaseButtonTestTags
import com.tangem.core.ui.test.WalletConnectBottomSheetTestTags
import com.tangem.core.ui.test.WalletConnectDetailsBottomSheetTestTags
import io.github.kakaocup.compose.node.element.ComposeScreen
import io.github.kakaocup.compose.node.element.ComposeScreen.Companion.onComposeScreen
import io.github.kakaocup.compose.node.element.KNode
import io.github.kakaocup.kakao.common.utilities.getResourceString
import com.tangem.features.walletconnect.impl.R as WalletConnectImplR
class WalletConnectDetailsBottomSheetPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) :
ComposeScreen<WalletConnectDetailsBottomSheetPageObject>(semanticsProvider = semanticsProvider) {
val title: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.TITLE)
hasText(getResourceString(WalletConnectImplR.string.wc_connected_app_title))
useUnmergedTree = true
}
val date: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.DATE)
useUnmergedTree = true
}
val closeButton: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.CLOSE_BUTTON)
useUnmergedTree = true
}
val networksBlockTitle: KNode = child {
hasText(getResourceString(WalletConnectImplR.string.wc_connected_networks))
useUnmergedTree = true
}
val appIcon: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.APP_ICON)
useUnmergedTree = true
}
val approveIcon: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.APPROVE_ICON)
useUnmergedTree = true
}
val appName: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.APP_NAME)
useUnmergedTree = true
}
val appUrl: KNode = child {
hasTestTag(WalletConnectBottomSheetTestTags.APP_URL)
useUnmergedTree = true
}
val walletIcon: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.WALLET_ICON)
useUnmergedTree = true
}
val walletTitle: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.WALLET_TITLE)
useUnmergedTree = true
}
val walletName: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.WALLET_NAME)
useUnmergedTree = true
}
val connectedNetworksTitle: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.NETWORKS_TITLE)
useUnmergedTree = true
}
val connectedNetworkItem: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.NETWORK_ITEM)
useUnmergedTree = true
}
val connectedNetworkIcon: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.NETWORK_ICON)
useUnmergedTree = true
}
val connectedNetworkName: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.NETWORK_NAME)
useUnmergedTree = true
}
val connectedNetworkSymbol: KNode = child {
hasTestTag(WalletConnectDetailsBottomSheetTestTags.NETWORK_SYMBOL)
useUnmergedTree = true
}
val disconnectButton: KNode = child {
hasText(getResourceString(WalletConnectImplR.string.common_disconnect))
hasTestTag(BaseButtonTestTags.TEXT)
useUnmergedTree = true
}
}
internal fun BaseTestCase.onWalletConnectDetailsBottomSheet(function: WalletConnectDetailsBottomSheetPageObject.() -> Unit) =
onComposeScreen(composeTestRule, function)

View file

@ -0,0 +1,59 @@
package com.tangem.screens
import androidx.compose.ui.test.SemanticsNodeInteractionsProvider
import com.tangem.common.BaseTestCase
import com.tangem.core.ui.R
import com.tangem.core.ui.test.BaseButtonTestTags
import com.tangem.core.ui.test.WalletConnectScreenTestTags
import io.github.kakaocup.compose.node.element.ComposeScreen
import io.github.kakaocup.compose.node.element.ComposeScreen.Companion.onComposeScreen
import io.github.kakaocup.compose.node.element.KNode
import io.github.kakaocup.kakao.common.utilities.getResourceString
class WalletConnectPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) :
ComposeScreen<WalletConnectPageObject>(semanticsProvider = semanticsProvider) {
val title: KNode = child {
hasText(getResourceString(R.string.wc_connections))
useUnmergedTree = true
}
val moreButton: KNode = child {
hasTestTag(WalletConnectScreenTestTags.MORE_BUTTON)
useUnmergedTree = true
}
val walletName: KNode = child {
hasTestTag(WalletConnectScreenTestTags.WALLET_NAME)
useUnmergedTree = true
}
val appIcon: KNode = child {
hasTestTag(WalletConnectScreenTestTags.APP_ICON)
useUnmergedTree = true
}
val appName: KNode = child {
hasTestTag(WalletConnectScreenTestTags.APP_NAME)
useUnmergedTree = true
}
val approveIcon: KNode = child {
hasTestTag(WalletConnectScreenTestTags.APPROVE_ICON)
useUnmergedTree = true
}
val appUrl: KNode = child {
hasTestTag(WalletConnectScreenTestTags.APP_URL)
useUnmergedTree = true
}
val newConnectionButton: KNode = child {
hasTestTag(BaseButtonTestTags.TEXT)
hasText(getResourceString(R.string.wc_new_connection))
useUnmergedTree = true
}
}
internal fun BaseTestCase.onWalletConnectScreen(function: WalletConnectPageObject.() -> Unit) =
onComposeScreen(composeTestRule, function)

View file

@ -0,0 +1,38 @@
package com.tangem.steps
import com.tangem.common.BaseTestCase
import com.tangem.common.extensions.clickWithAssertion
import com.tangem.domain.models.scan.ProductType
import com.tangem.screens.onDisclaimerScreen
import com.tangem.screens.onMainScreen
import com.tangem.screens.onMarketsTooltipScreen
import com.tangem.screens.onStoriesScreen
import com.tangem.tap.domain.sdk.mocks.MockProvider
import io.qameta.allure.kotlin.Allure.step
fun BaseTestCase.openMainScreen(productType: ProductType? = null) {
if (productType != null) {
MockProvider.setMocks(productType)
}
step("Click on 'Accept' button") {
onDisclaimerScreen { acceptButton.clickWithAssertion() }
}
step("Click on 'Accept' button") {
onStoriesScreen { scanButton.clickWithAssertion() }
}
step("Assert main screen is displayed") {
onMainScreen { screenContainer.assertIsDisplayed() }
}
step("Assert main screen is displayed") {
onMarketsTooltipScreen { contentContainer.clickWithAssertion() }
}
}
fun BaseTestCase.synchronizeAddresses(balance: String) {
step("Click on 'Synchronize addresses' button") {
onMainScreen { synchronizeAddressesButton.clickWithAssertion() }
}
step("Assert wallet balance = '$balance'") {
onMainScreen { walletBalance().assertTextContains(balance) }
}
}

View file

@ -0,0 +1,15 @@
package com.tangem.steps
import android.content.Intent
import android.net.Uri
import androidx.test.core.app.ApplicationProvider
fun openAppByDeepLink(deepLinkUri: String?) {
val deeplinkScheme = "tangem://wc?uri="
val context = ApplicationProvider.getApplicationContext<android.content.Context>()
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(deeplinkScheme + deepLinkUri)).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
}

View file

@ -0,0 +1,139 @@
package com.tangem.steps
import com.tangem.common.BaseTestCase
import com.tangem.screens.onWalletConnectBottomSheet
import com.tangem.screens.onWalletConnectDetailsBottomSheet
import com.tangem.screens.onWalletConnectScreen
import io.qameta.allure.kotlin.Allure.step
fun BaseTestCase.checkWalletConnectBottomSheet() {
step("Assert 'Wallet Connect' bottom sheet title is displayed") {
onWalletConnectBottomSheet { title.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet app icon is displayed") {
onWalletConnectBottomSheet { appIcon.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet app name is displayed") {
onWalletConnectBottomSheet { appName.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet approve icon is displayed") {
onWalletConnectBottomSheet { approveIcon.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet app URL is displayed") {
onWalletConnectBottomSheet { appUrl.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet connection request icon is displayed") {
onWalletConnectBottomSheet { connectionRequestIcon.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet connection request text is displayed") {
onWalletConnectBottomSheet { connectionRequestText.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet connection request chevron is displayed") {
onWalletConnectBottomSheet { connectionRequestChevron.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet wallet icon is displayed") {
onWalletConnectBottomSheet { walletIcon.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet wallet title is displayed") {
onWalletConnectBottomSheet { walletNameTitle.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet wallet name is displayed") {
onWalletConnectBottomSheet { walletName.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet networks icon is displayed") {
onWalletConnectBottomSheet { networksIcon.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet networks title is displayed") {
onWalletConnectBottomSheet { networksTitle.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet right networks icons is displayed") {
onWalletConnectBottomSheet { networksIcons.assertIsDisplayed() }
}
step("'Wallet Connect' bottom sheet networks selector icon is displayed") {
onWalletConnectBottomSheet { networksSelectorIcon.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet 'Cancel' button is displayed") {
onWalletConnectBottomSheet { cancelButton.assertIsDisplayed() }
}
step("Assert 'Wallet Connect' bottom sheet 'Connect' button is displayed") {
onWalletConnectBottomSheet { connectButton.assertIsDisplayed() }
}
}
fun BaseTestCase.checkWalletConnectScreen() {
step("Assert 'Wallet Connect' title is displayed") {
onWalletConnectScreen { title.assertIsDisplayed() }
}
step("Assert 'More' button is displayed") {
onWalletConnectScreen { moreButton.assertIsDisplayed() }
}
step("Assert wallet name is displayed") {
onWalletConnectScreen { walletName.assertIsDisplayed() }
}
step("Assert app icon is displayed") {
onWalletConnectScreen { appIcon.assertIsDisplayed() }
}
step("Assert app name is displayed") {
onWalletConnectScreen { appName.assertIsDisplayed() }
}
step("Assert approve icon is displayed") {
onWalletConnectScreen { approveIcon.assertIsDisplayed() }
}
step("Assert app URL is displayed") {
onWalletConnectScreen { appUrl.assertIsDisplayed() }
}
step("Assert 'New Connection' button is displayed") {
onWalletConnectScreen { newConnectionButton.assertIsDisplayed() }
}
}
fun BaseTestCase.checkWalletConnectDetailsBottomSheet(dAppName: String) {
step("Assert connection details title is displayed") {
onWalletConnectDetailsBottomSheet { title.assertIsDisplayed() }
}
step("Assert date is displayed") {
onWalletConnectDetailsBottomSheet { date.assertIsDisplayed() }
}
step("Assert 'Close' button is displayed") {
onWalletConnectDetailsBottomSheet { closeButton.assertIsDisplayed() }
}
step("Assert app icon is displayed") {
onWalletConnectDetailsBottomSheet { appIcon.assertIsDisplayed() }
}
step("Assert app name is displayed") {
onWalletConnectDetailsBottomSheet { appName.assertIsDisplayed() }
}
step("Assert approve icon is displayed") {
onWalletConnectDetailsBottomSheet { approveIcon.assertIsDisplayed() }
}
step("Assert app URL is displayed") {
onWalletConnectDetailsBottomSheet { appUrl.assertIsDisplayed() }
}
step("Assert wallet icon is displayed") {
onWalletConnectDetailsBottomSheet { walletIcon.assertIsDisplayed() }
}
step("Assert wallet title is displayed") {
onWalletConnectDetailsBottomSheet { walletTitle.assertIsDisplayed() }
}
step("Assert wallet name is displayed") {
onWalletConnectDetailsBottomSheet { walletName.assertIsDisplayed() }
}
step("Assert 'Connected networks' title is displayed") {
onWalletConnectDetailsBottomSheet { connectedNetworksTitle.assertIsDisplayed() }
}
step("Assert connected network item is displayed") {
onWalletConnectDetailsBottomSheet { connectedNetworkItem.assertIsDisplayed() }
}
step("Assert connected network icon is displayed") {
onWalletConnectDetailsBottomSheet { connectedNetworkIcon.assertIsDisplayed() }
}
step("Assert connected dApp name: '$dAppName'") {
onWalletConnectDetailsBottomSheet { connectedNetworkName.assertTextContains(dAppName) }
}
step("Assert connected network symbol is displayed") {
onWalletConnectDetailsBottomSheet { connectedNetworkSymbol.assertIsDisplayed() }
}
step("Assert 'Disconnect button' is displayed") {
onWalletConnectDetailsBottomSheet { disconnectButton.assertIsDisplayed() }
}
}

View file

@ -0,0 +1,181 @@
package com.tangem.tests
import com.tangem.common.BaseTestCase
import com.tangem.common.constants.TestConstants.TOTAL_BALANCE
import com.tangem.common.extensions.clickWithAssertion
import com.tangem.common.extensions.swipeUp
import com.tangem.common.utils.getWcUri
import com.tangem.scenarios.OpenMainScreenScenario
import com.tangem.screens.*
import com.tangem.steps.*
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
class WalletConnectTest : BaseTestCase() {
@AllureId("3833")
@DisplayName("WC (React App): open session from deeplink on main screen")
@Ignore("TODO [REDACTED_JIRA] React app deeplink doesn't work")
@Test
fun openWalletConnectSessionOnMainScreen() {
val balance = TOTAL_BALANCE
val dAppName = "React App"
val deepLinkUri = getWcUri()
setupHooks().run {
step("Open 'Main Screen'") {
openMainScreen()
}
step("Synchronize addresses") {
synchronizeAddresses(balance)
}
step("Create WC session buy deeplink") {
openAppByDeepLink(deepLinkUri)
}
step("Check 'Wallet Connect' bottom sheet") {
checkWalletConnectBottomSheet()
}
step("Click on 'Connect' button") {
onWalletConnectBottomSheet { connectButton.performClick() }
}
step("Click 'More' button on TopBar") {
onTopBar { moreButton.clickWithAssertion() }
}
step("Click on 'Wallet Connect' button") {
onDetailsScreen { walletConnectButton.clickWithAssertion() }
}
step("Check 'Wallet Connect' screen") {
checkWalletConnectScreen()
}
step("Click on app icon") {
onWalletConnectScreen { appIcon.performClick() }
}
step("Check 'Wallet Connect' details bottom sheet") {
checkWalletConnectDetailsBottomSheet(dAppName)
}
step("Click on 'Disconnect button' is displayed") {
onWalletConnectDetailsBottomSheet { disconnectButton.performClick() }
}
step("Assert connection is not displayed") {
onWalletConnectScreen { appName.assertIsNotDisplayed() }
}
}
}
@AllureId("3834")
@DisplayName("WC (React App): open session from deeplink not on main screen")
@Ignore("TODO [REDACTED_JIRA] React app deeplink doesn't work")
@Test
fun openWalletConnectSessionNotOnMainScreen() {
val balance = TOTAL_BALANCE
val dAppName = "React App"
val deepLinkUri = getWcUri()
setupHooks().run {
step("Open 'Main Screen'") {
openMainScreen()
}
step("Synchronize addresses") {
synchronizeAddresses(balance)
}
step("Click on 'Buy' button") {
onMainScreen { buyButton.clickWithAssertion() }
}
step("Create WC session buy deeplink") {
openAppByDeepLink(deepLinkUri)
}
step("Check 'Wallet Connect' bottom sheet") {
checkWalletConnectBottomSheet()
}
step("Click on 'Connect' button") {
onWalletConnectBottomSheet { connectButton.performClick() }
}
step("Click 'More' button on TopBar") {
onTopBar { moreButton.clickWithAssertion() }
}
step("Click on 'Wallet Connect' button") {
onDetailsScreen { walletConnectButton.clickWithAssertion() }
}
step("Assert 'Wallet Connect' bottom sheet is displayed") {
onWalletConnectBottomSheet { connectButton.clickWithAssertion() }
}
step("Check 'Wallet Connect' screen") {
checkWalletConnectScreen()
}
step("Click on app icon") {
onWalletConnectScreen { appIcon.performClick() }
}
step("Check 'Wallet Connect' details bottom sheet") {
checkWalletConnectDetailsBottomSheet(dAppName)
}
step("Click on 'Disconnect button' is displayed") {
onWalletConnectDetailsBottomSheet { disconnectButton.performClick() }
}
step("Assert connection is not displayed") {
onWalletConnectScreen { appName.assertIsNotDisplayed() }
}
}
}
@AllureId("886")
@DisplayName("WC (React App): open session from deeplink ")
@Ignore("TODO [REDACTED_JIRA] React app deeplink doesn't work")
@Test
fun openWalletConnectSession() {
val balance = TOTAL_BALANCE
val dAppName = "React App"
val deepLinkUri = getWcUri()
setupHooks().run {
step("Open 'Main Screen'") {
openMainScreen()
}
step("Synchronize addresses") {
synchronizeAddresses(balance)
}
step("Open recent apps") {
device.uiDevice.pressRecentApps()
}
step("Stop app by swipe") {
swipeUp(startHeightRatio = 0.8f)
}
step("Create WC session buy deeplink") {
openAppByDeepLink(deepLinkUri)
}
step("Open 'Main Screen'") {
scenario(OpenMainScreenScenario(composeTestRule))
}
step("Check 'Wallet Connect' bottom sheet") {
checkWalletConnectBottomSheet()
}
step("Click on 'Connect' button") {
onWalletConnectBottomSheet { connectButton.performClick() }
}
step("Click 'More' button on TopBar") {
onTopBar { moreButton.clickWithAssertion() }
}
step("Click on 'Wallet Connect' button") {
onDetailsScreen { walletConnectButton.clickWithAssertion() }
}
step("Check 'Wallet Connect' screen") {
checkWalletConnectScreen()
}
step("Click on app icon") {
onWalletConnectScreen { appIcon.performClick() }
}
step("Check 'Wallet Connect' details bottom sheet") {
checkWalletConnectDetailsBottomSheet(dAppName)
}
step("Click on 'Disconnect button' is displayed") {
onWalletConnectDetailsBottomSheet { disconnectButton.performClick() }
}
step("Assert connection is not displayed") {
onWalletConnectScreen { appName.assertIsNotDisplayed() }
}
}
}
}