[#282] Tests fail on low resolution devices.
- Scrolling enabled for screens from Backup and Profile parts of the app. - UI tests improved to always scroll to the desired views before working with them.
This commit is contained in:
parent
e44e901676
commit
fff0dc4110
|
@ -9,6 +9,7 @@ import androidx.compose.ui.test.onAllNodesWithTag
|
||||||
import androidx.compose.ui.test.onChildren
|
import androidx.compose.ui.test.onChildren
|
||||||
import androidx.compose.ui.test.onNodeWithText
|
import androidx.compose.ui.test.onNodeWithText
|
||||||
import androidx.compose.ui.test.performClick
|
import androidx.compose.ui.test.performClick
|
||||||
|
import androidx.compose.ui.test.performScrollTo
|
||||||
import androidx.test.filters.MediumTest
|
import androidx.test.filters.MediumTest
|
||||||
import cash.z.ecc.sdk.fixture.PersistableWalletFixture
|
import cash.z.ecc.sdk.fixture.PersistableWalletFixture
|
||||||
import co.electriccoin.zcash.ui.R
|
import co.electriccoin.zcash.ui.R
|
||||||
|
@ -54,6 +55,7 @@ class BackupViewTest {
|
||||||
val testSetup = newTestSetup(BackupStage.Seed)
|
val testSetup = newTestSetup(BackupStage.Seed)
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(getStringResource(R.string.new_wallet_3_button_copy)).also {
|
composeTestRule.onNodeWithText(getStringResource(R.string.new_wallet_3_button_copy)).also {
|
||||||
|
it.performScrollTo()
|
||||||
it.performClick()
|
it.performClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +115,10 @@ class BackupViewTest {
|
||||||
|
|
||||||
assertEquals(BackupStage.Seed, testSetup.getStage())
|
assertEquals(BackupStage.Seed, testSetup.getStage())
|
||||||
|
|
||||||
composeTestRule.onNode(hasText(getStringResource(R.string.new_wallet_3_button_finished))).performClick()
|
composeTestRule.onNode(hasText(getStringResource(R.string.new_wallet_3_button_finished))).also {
|
||||||
|
it.performScrollTo()
|
||||||
|
it.performClick()
|
||||||
|
}
|
||||||
|
|
||||||
assertEquals(BackupStage.Test, testSetup.getStage())
|
assertEquals(BackupStage.Test, testSetup.getStage())
|
||||||
|
|
||||||
|
@ -171,12 +176,14 @@ class BackupViewTest {
|
||||||
assertEquals(BackupStage.Seed, testSetup.getStage())
|
assertEquals(BackupStage.Seed, testSetup.getStage())
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(getStringResource(R.string.new_wallet_3_button_copy)).also {
|
composeTestRule.onNodeWithText(getStringResource(R.string.new_wallet_3_button_copy)).also {
|
||||||
|
it.performScrollTo()
|
||||||
it.performClick()
|
it.performClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(1, testSetup.getOnCopyToClipboardCount())
|
assertEquals(1, testSetup.getOnCopyToClipboardCount())
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(getStringResource(R.string.new_wallet_3_button_finished)).also {
|
composeTestRule.onNodeWithText(getStringResource(R.string.new_wallet_3_button_finished)).also {
|
||||||
|
it.performScrollTo()
|
||||||
it.performClick()
|
it.performClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,7 @@ class ProfileViewTest {
|
||||||
assertEquals(0, testSetup.getOnSettingsCount())
|
assertEquals(0, testSetup.getOnSettingsCount())
|
||||||
|
|
||||||
composeTestRule.onNodeWithText(getStringResource(R.string.profile_settings)).also {
|
composeTestRule.onNodeWithText(getStringResource(R.string.profile_settings)).also {
|
||||||
|
it.performScrollTo()
|
||||||
it.performClick()
|
it.performClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxHeight
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.Card
|
import androidx.compose.material3.Card
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
@ -121,7 +123,7 @@ private fun EducationRecoveryPhrase(onNext: () -> Unit) {
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun SeedPhrase(persistableWallet: PersistableWallet, onNext: () -> Unit, onCopyToClipboard: () -> Unit) {
|
private fun SeedPhrase(persistableWallet: PersistableWallet, onNext: () -> Unit, onCopyToClipboard: () -> Unit) {
|
||||||
Column {
|
Column(Modifier.verticalScroll(rememberScrollState())) {
|
||||||
Header(stringResource(R.string.new_wallet_3_header))
|
Header(stringResource(R.string.new_wallet_3_header))
|
||||||
Body(stringResource(R.string.new_wallet_3_body_1))
|
Body(stringResource(R.string.new_wallet_3_body_1))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue