Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-10 17:37:21 +03:00
parent 8ea23a2dd7
commit 4f1710d77c
23 changed files with 884 additions and 29 deletions

View file

@ -1,8 +1,10 @@
package com.tangem.screens
import androidx.compose.ui.test.ExperimentalTestApi
import androidx.compose.ui.test.SemanticsNodeInteractionsProvider
import com.tangem.common.BaseTestCase
import com.tangem.core.ui.R
import com.tangem.core.ui.test.TokenReceiveAssetsBottomSheetTestTags
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
@ -11,10 +13,23 @@ import io.github.kakaocup.kakao.common.utilities.getResourceString
class ReceiveAssetsBottomSheetPageObject(semanticsProvider: SemanticsNodeInteractionsProvider) :
ComposeScreen<ReceiveAssetsBottomSheetPageObject>(semanticsProvider = semanticsProvider) {
val showQrCodeButton: KNode = child {
/** 'Show QR code' button of the address at [index]; both pager cards stay composed, so match by position. */
fun showQrCodeButton(index: Int = 0): KNode = child {
hasText(getResourceString(R.string.token_receive_show_qr_code_title))
hasPosition(index)
useUnmergedTree = true
}
val addressesPager: KNode = child {
hasTestTag(TokenReceiveAssetsBottomSheetTestTags.ADDRESSES_PAGER)
useUnmergedTree = true
}
/** Pages the addresses carousel to the address of the given [index]. */
@OptIn(ExperimentalTestApi::class)
fun scrollToAddress(index: Int) {
addressesPager { performScrollToIndex(index) }
}
}
internal fun BaseTestCase.onReceiveAssetsBottomSheet(function: ReceiveAssetsBottomSheetPageObject.() -> Unit) =