mirror of
https://github.com/bitwarden/android.git
synced 2026-05-11 10:54:26 -05:00
Fix formatting
This commit is contained in:
@@ -6,5 +6,5 @@ import kotlinx.serialization.Serializable
|
||||
data class TestData(
|
||||
val baseUrl: String,
|
||||
val email: String,
|
||||
val password: String
|
||||
val password: String,
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ abstract class Page(protected val composeTestRule: ComposeTestRule) {
|
||||
return composeTestRule.onNodeWithTag(testTag)
|
||||
}
|
||||
|
||||
protected fun getElementByText(text: String): SemanticsNodeInteraction{
|
||||
protected fun getElementByText(text: String): SemanticsNodeInteraction {
|
||||
waitForIdle()
|
||||
waitUntil(TIMEOUT_MILLIS) {
|
||||
try {
|
||||
@@ -66,7 +66,7 @@ abstract class Page(protected val composeTestRule: ComposeTestRule) {
|
||||
*/
|
||||
protected fun waitUntil(
|
||||
timeoutMillis: Long,
|
||||
condition: () -> Boolean
|
||||
condition: () -> Boolean,
|
||||
) {
|
||||
composeTestRule.waitUntil(timeoutMillis) { condition() }
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ import androidx.compose.ui.test.performTextInput
|
||||
import com.x8bit.bitwarden.e2e.pages.LoginPage
|
||||
import e2e.pageObjects.Page
|
||||
|
||||
class EnvironmentSettingsPage(composeTestRule: ComposeTestRule) : Page(composeTestRule){
|
||||
class EnvironmentSettingsPage(composeTestRule: ComposeTestRule) : Page(composeTestRule) {
|
||||
|
||||
private val serverURLField by lazy { getElement("ServerUrlEntry") }
|
||||
private val saveButton by lazy { getElement("SaveButton") }
|
||||
|
||||
fun setupEnvironment(url: String) : LoginPage {
|
||||
fun setupEnvironment(url: String): LoginPage {
|
||||
serverURLField
|
||||
.performClick()
|
||||
.performTextInput(url)
|
||||
|
||||
@@ -11,7 +11,7 @@ import e2e.pageObjects.vault.VaultPage
|
||||
* Page Object representing the Login screen of the Bitwarden app.
|
||||
* This class encapsulates all the UI elements and actions available on the login screen.
|
||||
*/
|
||||
class LoginPage(composeTestRule: ComposeTestRule) : Page(composeTestRule){
|
||||
class LoginPage(composeTestRule: ComposeTestRule) : Page(composeTestRule) {
|
||||
|
||||
// UI Elements
|
||||
private val emailField by lazy { getElement("EmailAddressEntry") }
|
||||
@@ -24,7 +24,6 @@ class LoginPage(composeTestRule: ComposeTestRule) : Page(composeTestRule){
|
||||
private val allowScreenCaptureToggle by lazy { getElement("AllowScreenCaptureSwitch") }
|
||||
private val goBackButton by lazy { getElement("CloseButton") }
|
||||
|
||||
|
||||
/**
|
||||
* Enters the master password in the password field
|
||||
* @param password The master password to enter
|
||||
@@ -43,14 +42,14 @@ class LoginPage(composeTestRule: ComposeTestRule) : Page(composeTestRule){
|
||||
return VaultPage(composeTestRule)
|
||||
}
|
||||
|
||||
fun openEnvironmentSettings() : EnvironmentSettingsPage {
|
||||
fun openEnvironmentSettings(): EnvironmentSettingsPage {
|
||||
regionSelectorButton.performClick()
|
||||
getElementByText("Self-hosted")
|
||||
.performClick()
|
||||
return EnvironmentSettingsPage(composeTestRule)
|
||||
}
|
||||
|
||||
fun turnOnScreenRecording() : LoginPage {
|
||||
fun turnOnScreenRecording(): LoginPage {
|
||||
openSettingsButton.performClick()
|
||||
otherSettingsButton.performClick()
|
||||
allowScreenCaptureToggle.performClick()
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.compose.ui.test.*
|
||||
import e2e.pageObjects.Page
|
||||
import e2e.pageObjects.settings.accountSecurity.AccountSecurityPage
|
||||
|
||||
class SettingsPage (composeTestRule: ComposeTestRule) : Page(composeTestRule) {
|
||||
class SettingsPage(composeTestRule: ComposeTestRule) : Page(composeTestRule) {
|
||||
|
||||
// UI Elements
|
||||
private val accountSecurityButton by lazy { getElement("AccountSecuritySettingsButton") }
|
||||
|
||||
@@ -9,7 +9,7 @@ import e2e.pageObjects.vault.UnlockVaultPage
|
||||
* Page Object representing the Account Security screen of the Bitwarden app.
|
||||
* This class encapsulates all the UI elements and actions available on the account security screen.
|
||||
*/
|
||||
class AccountSecurityPage(composeTestRule: ComposeTestRule) : Page(composeTestRule) {
|
||||
class AccountSecurityPage(composeTestRule: ComposeTestRule) : Page(composeTestRule) {
|
||||
|
||||
// UI Elements
|
||||
private val lockNowLabel by lazy { getElement("LockNowLabel") }
|
||||
|
||||
@@ -13,7 +13,6 @@ class UnlockVaultPage(composeTestRule: ComposeTestRule) : Page(composeTestRule)
|
||||
private val passwordEntryTag by lazy { getElement("MasterPasswordEntry") }
|
||||
private val unlockVaultButtonTag by lazy { getElement("UnlockVaultButton") }
|
||||
|
||||
|
||||
fun enterPassword(password: String): UnlockVaultPage {
|
||||
passwordEntryTag.performTextInput(password)
|
||||
return this
|
||||
|
||||
Reference in New Issue
Block a user