From 7bedb1f4fd548c3a385731baf1895342c078e5a2 Mon Sep 17 00:00:00 2001 From: ifernandezdiaz Date: Mon, 14 Jul 2025 15:10:42 -0300 Subject: [PATCH] Adding steps to enable screen recording --- .../kotlin/e2e/pageObjects/login/LoginPage.kt | 14 ++++++++++++++ .../kotlin/e2e/tests/RealDeviceE2ETests.kt | 1 + .../ui/auth/feature/landing/LandingScreen.kt | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/src/androidTest/kotlin/e2e/pageObjects/login/LoginPage.kt b/app/src/androidTest/kotlin/e2e/pageObjects/login/LoginPage.kt index d4f5256c4b..1fd8cbe100 100644 --- a/app/src/androidTest/kotlin/e2e/pageObjects/login/LoginPage.kt +++ b/app/src/androidTest/kotlin/e2e/pageObjects/login/LoginPage.kt @@ -19,6 +19,11 @@ class LoginPage(composeTestRule: ComposeTestRule) : Page(composeTestRule){ private val continueButton by lazy { getElement("ContinueButton") } private val loginWithMasterPasswordButton by lazy { getElement("LogInWithMasterPasswordButton") } private val regionSelectorButton by lazy { getElement("RegionSelectorDropdown") } + private val openSettingsButton by lazy { getElement("AppSettingsButton") } + private val otherSettingsButton by lazy { getElement("OtherSettingsButton") } + private val allowScreenCaptureToggle by lazy { getElement("AllowScreenCaptureSwitch") } + private val goBackButton by lazy { getElement("CloseButton") } + /** * Enters the master password in the password field @@ -44,4 +49,13 @@ class LoginPage(composeTestRule: ComposeTestRule) : Page(composeTestRule){ .performClick() return EnvironmentSettingsPage(composeTestRule) } + + fun turnOnScreenRecording() : LoginPage { + openSettingsButton.performClick() + otherSettingsButton.performClick() + allowScreenCaptureToggle.performClick() + goBackButton.performClick() + goBackButton.performClick() + return this + } } diff --git a/app/src/androidTest/kotlin/e2e/tests/RealDeviceE2ETests.kt b/app/src/androidTest/kotlin/e2e/tests/RealDeviceE2ETests.kt index 23ec317718..f9dddeff1c 100644 --- a/app/src/androidTest/kotlin/e2e/tests/RealDeviceE2ETests.kt +++ b/app/src/androidTest/kotlin/e2e/tests/RealDeviceE2ETests.kt @@ -13,6 +13,7 @@ class RealDeviceE2ETests : BaseE2ETest() { fun testVaultLockUnlockFlow() { MainPage(composeTestRule) .startLogin() + .turnOnScreenRecording() .openEnvironmentSettings() .setupEnvironment(testData.baseUrl) .performLogin(testData.email, testData.password) diff --git a/app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/landing/LandingScreen.kt b/app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/landing/LandingScreen.kt index f7a84a6937..d9e0b0d5f0 100644 --- a/app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/landing/LandingScreen.kt +++ b/app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/landing/LandingScreen.kt @@ -326,7 +326,8 @@ private fun LandingScreenContent( icon = rememberVectorPainter(id = BitwardenDrawable.ic_cog), modifier = Modifier .standardHorizontalMargin() - .fillMaxWidth(), + .fillMaxWidth() + .testTag("AppSettingsButton"), ) Spacer(modifier = Modifier.height(height = 12.dp))