Fix formatting

This commit is contained in:
ifernandezdiaz
2025-07-14 16:38:33 -03:00
parent 47a9117590
commit 7dc5b99342
7 changed files with 10 additions and 12 deletions

View File

@@ -6,5 +6,5 @@ import kotlinx.serialization.Serializable
data class TestData(
val baseUrl: String,
val email: String,
val password: String
val password: String,
)

View File

@@ -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() }
}

View File

@@ -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)

View File

@@ -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()

View File

@@ -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") }

View File

@@ -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") }

View File

@@ -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