From c4cc6128d1176bb6f59c49d79639d68fc09c8c46 Mon Sep 17 00:00:00 2001 From: emmaoke-w Date: Mon, 15 Jun 2026 10:34:30 +0200 Subject: [PATCH 1/2] test: Add team creation e2e coverage (WPB-26345) --- .../criticalFlows/PersonalAccountLifeCycle.kt | 10 +- .../e2eTests/PersonalUserRegistrationTest.kt | 9 +- .../tests/core/e2eTests/TeamCreationTest.kt | 407 ++++++++++++++++++ .../wire/android/tests/core/pages/AllPages.kt | 2 + .../tests/core/pages/RegistrationPage.kt | 12 +- .../tests/core/pages/TeamCreationPage.kt | 139 ++++++ 6 files changed, 568 insertions(+), 11 deletions(-) create mode 100644 tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/TeamCreationTest.kt create mode 100644 tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/TeamCreationPage.kt diff --git a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/criticalFlows/PersonalAccountLifeCycle.kt b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/criticalFlows/PersonalAccountLifeCycle.kt index 204c10aa1ce..3feba278283 100644 --- a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/criticalFlows/PersonalAccountLifeCycle.kt +++ b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/criticalFlows/PersonalAccountLifeCycle.kt @@ -17,10 +17,10 @@ */ package com.wire.android.tests.core.criticalFlows +import InbucketClient import androidx.test.ext.junit.runners.AndroidJUnit4 import org.junit.runner.RunWith import backendUtils.BackendClient -import com.wire.android.testSupport.BuildConfig import com.wire.android.tests.core.BaseUiTest import com.wire.android.tests.support.UiAutomatorSetup import com.wire.android.tests.support.tags.Category @@ -110,10 +110,10 @@ class PersonalAccountLifeCycle : BaseUiTest() { step("Fetch OTP to complete 2FA verification and complete registration") { val otp = runBlocking { InbucketClient.getVerificationCode( - personalUser?.email.orEmpty(), - BuildConfig.BACKENDCONNECTION_STAGING_INBUCKETURL, - BuildConfig.BACKENDCONNECTION_STAGING_INBUCKETPASSWORD, - BuildConfig.BACKENDCONNECTION_STAGING_INBUCKETUSERNAME + personalUser?.email!!, + backendClient.inbucketUrl, + backendClient.inbucketPassword, + backendClient.inbucketUsername ) } diff --git a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/PersonalUserRegistrationTest.kt b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/PersonalUserRegistrationTest.kt index 32d75e9feb0..93dae089844 100644 --- a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/PersonalUserRegistrationTest.kt +++ b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/PersonalUserRegistrationTest.kt @@ -19,7 +19,7 @@ package com.wire.android.tests.core.e2eTests import InbucketClient import androidx.test.ext.junit.runners.AndroidJUnit4 -import com.wire.android.testSupport.BuildConfig +import backendUtils.BackendClient import com.wire.android.tests.core.BaseUiTest import com.wire.android.tests.support.UiAutomatorSetup import com.wire.android.tests.support.tags.Category @@ -42,6 +42,7 @@ class PersonalUserRegistrationTest : BaseUiTest() { @Before fun setUp() { device = UiAutomatorSetup.start(UiAutomatorSetup.APP_ALPHA) + backendClient = BackendClient.loadBackend("STAGING") } @Suppress("LongMethod") @@ -106,9 +107,9 @@ class PersonalUserRegistrationTest : BaseUiTest() { otp = runBlocking { InbucketClient.getVerificationCode( userInfo.email, - BuildConfig.BACKENDCONNECTION_STAGING_INBUCKETURL, - BuildConfig.BACKENDCONNECTION_STAGING_INBUCKETPASSWORD, - BuildConfig.BACKENDCONNECTION_STAGING_INBUCKETUSERNAME + backendClient.inbucketUrl, + backendClient.inbucketPassword, + backendClient.inbucketUsername ) } } diff --git a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/TeamCreationTest.kt b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/TeamCreationTest.kt new file mode 100644 index 00000000000..7c1148cc9ed --- /dev/null +++ b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/TeamCreationTest.kt @@ -0,0 +1,407 @@ +/* + * Wire + * Copyright (C) 2026 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ +package com.wire.android.tests.core.e2eTests + +import InbucketClient +import androidx.test.ext.junit.runners.AndroidJUnit4 +import backendUtils.BackendClient +import com.wire.android.tests.core.BaseUiTest +import com.wire.android.tests.support.UiAutomatorSetup +import com.wire.android.tests.support.tags.Category +import com.wire.android.tests.support.tags.TestCaseId +import kotlinx.coroutines.runBlocking +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import user.UserClient +import user.utils.ClientUser +import uiautomatorutils.KeyboardUtils.closeKeyboardIfOpened +import uiautomatorutils.UiWaitUtils +import uiautomatorutils.UiWaitUtils.iSeeSystemMessage +import kotlin.time.Duration.Companion.seconds + +@RunWith(AndroidJUnit4::class) +class TeamCreationTest : BaseUiTest() { + + @Before + fun setUp() { + initCommonTestHelpers() + device = UiAutomatorSetup.start(UiAutomatorSetup.APP_ALPHA) + backendClient = BackendClient.loadBackend("STAGING") + } + + @Suppress("CyclomaticComplexMethod", "LongMethod") + @TestCaseId("TC-4558", "TC-4562") + @Category("regression", "RC", "teamCreation") + @Test + fun givenIWantToBeAbleToCreateATeam_whenICompleteTeamCreation_thenTeamIsCreatedAndTeamOwnerSuccessfullyLogsIn() { + lateinit var userInfo: ClientUser + + step("Given User user1Name is available for team creation") { + userInfo = teamHelper.usersManager.findUserByNameOrNameAlias("user1Name") + } + + step("And I see email verification welcome page") { + pages.registrationPage.apply { + assertEmailWelcomePage() + } + } + + step("And I open staging backend via deep link and proceed") { + pages.loginPage.apply { + clickStagingDeepLink() + clickProceedButtonOnDeeplinkOverlay() + } + } + + step("When I enter my email and tap next on email verification welcome page") { + pages.registrationPage.apply { + enterPersonalUserRegistrationEmail(userInfo.email) + clickLoginButton() + } + } + + step("And I start create team flow") { + pages.registrationPage.apply { + clickCreateAccountButton() + clickCreateTeamButton() + } + } + + step("Then I see create team page") { + pages.teamCreationPage.apply { + assertCreateTeamPageVisible() + } + } + + step("When I enter team owner details on create team page") { + pages.teamCreationPage.apply { + enterEmail(userInfo.email) + enterProfileName(userInfo.name) + enterTeamName("SuperTeam") + closeKeyboardIfOpened() + enterPassword(userInfo.password) + closeKeyboardIfOpened() + enterConfirmPassword(userInfo.password) + closeKeyboardIfOpened() + } + } + + step("And I select the first organization size option") { + pages.teamCreationPage.apply { + selectFirstOrganizationSizeOption() + UiWaitUtils.waitFor(2.seconds) + } + } + + step("And I accept terms and anonymous usage data options") { + pages.teamCreationPage.apply { + checkIAcceptTermsAndConditions() + checkIAgreeToShareAnonymousUsageData() + } + } + + step("And I tap continue button on create team page") { + pages.teamCreationPage.apply { + clickContinueButton() + } + } + + step("Then I see team verification code page") { + pages.teamCreationPage.apply { + assertYouHaveGotMailPageVisible() + } + } + + step("When I retrieve OTP from Inbucket and enter it on team verification page") { + val otp = runBlocking { + InbucketClient.getVerificationCode( + userInfo.email!!, + backendClient.inbucketUrl, + backendClient.inbucketPassword, + backendClient.inbucketUsername + ) + } + pages.teamCreationPage.apply { + enterVerificationCode(otp) + } + } + + step("Then I see team created page") { + pages.teamCreationPage.apply { + assertTeamCreatedPageVisible() + } + } + + step("When I close team created page") { + pages.teamCreationPage.apply { + closeTeamCreatedPage() + } + } + + // TC-4562 I want to reach login page on submit email page while registering a team + + step("Then I login as TeamOwner") { + pages.loginPage.apply { + enterTeamOwnerLoggingPassword(userInfo.password ?: "") + clickLoginButton() + } + } + + step("And I complete post-login permission and privacy prompts") { + pages.registrationPage.apply { + waitUntilLoginFlowIsCompleted() + clickAllowNotificationButton() + clickDeclineShareDataAlert() + } + } + + step("Then I see username setup page") { + pages.registrationPage.apply { + assertEnterYourUserNameInfoText() + assertUserNameHelpText() + } + } + + step("When I set username and confirm") { + pages.registrationPage.apply { + setUserName(userInfo.uniqueUsername) + clickConfirmButton() + } + } + + step("And I decline share data alert after username confirmation") { + pages.registrationPage.apply { + clickDeclineShareDataAlert() + } + } + + step("Then I see conversation list") { + pages.registrationPage.apply { + assertConversationPageVisible() + } + } + } + + @Suppress("LongMethod") + @TestCaseId("TC-4559", "TC-4560", "TC-4561") + @Category("regression", "RC", "teamCreation") + @Test + fun givenIWantToRegisterWithAnInvalidEmail_whenISubmitTheEmail_thenISeeAnError() { + lateinit var userInfo: ClientUser + + step("Given User user1Name is available for team creation") { + userInfo = teamHelper.usersManager.findUserByNameOrNameAlias("user1Name") + } + + step("And I see email verification welcome page") { + pages.registrationPage.apply { + assertEmailWelcomePage() + } + } + + step("And I open staging backend via deep link and proceed") { + pages.loginPage.apply { + clickStagingDeepLink() + clickProceedButtonOnDeeplinkOverlay() + } + } + + step("When I enter my email and tap next on email verification welcome page") { + pages.registrationPage.apply { + enterPersonalUserRegistrationEmail(userInfo.email) + clickLoginButton() + } + } + + step("And I start create team flow") { + pages.registrationPage.apply { + clickCreateAccountButton() + clickCreateTeamButton() + } + } + + step("Then I see create team page") { + pages.teamCreationPage.apply { + assertCreateTeamPageVisible() + } + } + + step("When I enter invalid email and valid team owner details on create team page") { + pages.teamCreationPage.apply { + enterEmail("smokester+invalid@wire") + enterProfileName(userInfo.name) + enterTeamName("SuperTeam") + closeKeyboardIfOpened() + enterPassword(userInfo.password) + closeKeyboardIfOpened() + enterConfirmPassword(userInfo.password) + closeKeyboardIfOpened() + } + } + + step("And I accept terms and conditions") { + pages.teamCreationPage.apply { + checkIAcceptTermsAndConditions() + } + } + + step("And I submit create team form") { + pages.teamCreationPage.apply { + clickContinueButton() + } + } + + step("Then I see invalid email error message") { + iSeeSystemMessage("Something went wrong. Please reload the page and try again.") + } + + // TC-4561 I want to see an error when my passwords do not match + + step("When I clear email and confirm password then enter valid email and unmatched confirm password") { + pages.teamCreationPage.apply { + enterEmail("") + enterEmail(userInfo.email) + enterConfirmPassword("") + enterConfirmPassword("unmatchedPassword") + closeKeyboardIfOpened() + } + } + + step("And I submit create team form") { + pages.teamCreationPage.apply { + clickContinueButton() + } + } + + step("Then I see password mismatch error message") { + iSeeSystemMessage("The password doesn’t match!") + } + + // TC-4560 I want to see an error when I use an invalid password + + step("When I clear password fields and enter invalid password in both fields") { + pages.teamCreationPage.apply { + enterPassword("") + enterPassword("invalidPassword") + enterConfirmPassword("") + enterConfirmPassword("invalidPassword") + closeKeyboardIfOpened() + } + } + + step("And I submit create team form") { + pages.teamCreationPage.apply { + clickContinueButton() + } + } + + step("Then I see invalid password requirements error message") { + iSeeSystemMessage( + "Use at least 8 characters, with one lowercase letter, one capital letter, a number, and a special character." + ) + } + } + + @Suppress("LongMethod") + @TestCaseId("TC-4563") + @Category("regression", "RC", "teamCreation") + @Test + fun givenIAmRegisteringATeam_whenIEnterAWrongVerificationCode_thenISeeAnError() { + lateinit var userInfo: ClientUser + + step("Given User user1Name is available for team creation") { + userInfo = teamHelper.usersManager.findUserByNameOrNameAlias("user1Name") + } + + step("And I see email verification welcome page") { + pages.registrationPage.apply { + assertEmailWelcomePage() + } + } + + step("And I open staging backend via deep link and proceed") { + pages.loginPage.apply { + clickStagingDeepLink() + clickProceedButtonOnDeeplinkOverlay() + } + } + + step("When I enter my email and tap next on email verification welcome page") { + pages.registrationPage.apply { + enterPersonalUserRegistrationEmail(userInfo.email) + clickLoginButton() + } + } + + step("And I start create team flow") { + pages.registrationPage.apply { + clickCreateAccountButton() + clickCreateTeamButton() + } + } + + step("Then I see create team page") { + pages.teamCreationPage.apply { + assertCreateTeamPageVisible() + } + } + + step("When I enter team owner details on create team page") { + pages.teamCreationPage.apply { + enterEmail(userInfo.email) + enterProfileName(userInfo.name) + enterTeamName("SuperTeam") + closeKeyboardIfOpened() + enterPassword(userInfo.password) + closeKeyboardIfOpened() + enterConfirmPassword(userInfo.password) + closeKeyboardIfOpened() + } + } + + step("And I accept terms and conditions") { + pages.teamCreationPage.apply { + checkIAcceptTermsAndConditions() + } + } + + step("And I tap continue button on create team page") { + pages.teamCreationPage.apply { + clickContinueButton() + } + } + + step("Then I see team verification code page") { + pages.teamCreationPage.apply { + assertYouHaveGotMailPageVisible() + } + } + + step("When I enter incorrect OTP on team verification page") { + val incorrectOtp = UserClient.RandomStringGenerator.randomNumeric(6) + pages.teamCreationPage.apply { + enterVerificationCode(incorrectOtp) + } + } + + step("Then I see wrong verification code error message") { + iSeeSystemMessage("Please retry, or request another code.") + } + } +} diff --git a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/AllPages.kt b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/AllPages.kt index f0340f322e9..dd49f72b0eb 100644 --- a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/AllPages.kt +++ b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/AllPages.kt @@ -41,6 +41,8 @@ class AllPages(val device: UiDevice) { val chromePage = ChromePage(device) + val teamCreationPage = TeamCreationPage(device) + val selfUserProfilePage = SelfUserProfilePage(device) val callingPage = CallingPage(device) diff --git a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/RegistrationPage.kt b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/RegistrationPage.kt index e43219ca351..dd7d8deddee 100644 --- a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/RegistrationPage.kt +++ b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/RegistrationPage.kt @@ -38,6 +38,7 @@ class RegistrationPage(private val device: UiDevice) { private val emailInputField = UiSelectorParams(resourceId = "userIdentifierInput") private val loginButton = UiSelectorParams(resourceId = "loginButton") private val createAccountButton = UiSelectorParams(text = "Create account or team") + private val createTeamButton = UiSelectorParams(text = "Create Team") private val createPersonalAccountButton = UiSelectorParams(text = "Create Personal Account") private val continueButton = UiSelectorParams(text = "Continue") private val termsTitle = UiSelectorParams(text = "Terms of Use") @@ -73,7 +74,7 @@ class RegistrationPage(private val device: UiDevice) { return this } - fun enterPersonalUserRegistrationEmail(email: String): RegistrationPage { + fun enterPersonalUserRegistrationEmail(email: String?): RegistrationPage { val success = UiWaitUtils.retryUntilTimeout( timeout = 6.seconds, pollingInterval = UiWaitUtils.POLLING_DEFAULT @@ -142,6 +143,13 @@ class RegistrationPage(private val device: UiDevice) { return this } + fun clickCreateTeamButton(): RegistrationPage { + val button = UiWaitUtils.waitElement(createTeamButton) + assertTrue("Button is not enabled", button.isEnabled) + button.click() + return this + } + fun clickContinueButton(): RegistrationPage { val button = UiWaitUtils.waitElement(continueButton) button.click() @@ -222,7 +230,7 @@ class RegistrationPage(private val device: UiDevice) { return this } - fun setUserName(username: String): RegistrationPage { + fun setUserName(username: String?): RegistrationPage { val userName = UiWaitUtils.waitElement(UiSelectorParams(className = "android.widget.EditText")) userName.click() userName.text = username diff --git a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/TeamCreationPage.kt b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/TeamCreationPage.kt new file mode 100644 index 00000000000..dfe79d40a00 --- /dev/null +++ b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/TeamCreationPage.kt @@ -0,0 +1,139 @@ +/* + * Wire + * Copyright (C) 2026 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ +package com.wire.android.tests.core.pages + +import android.view.KeyEvent +import androidx.test.uiautomator.By +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector +import org.junit.Assert.assertTrue +import uiautomatorutils.UiSelectorParams +import uiautomatorutils.UiWaitUtils +import kotlin.time.Duration.Companion.seconds + +class TeamCreationPage(private val device: UiDevice) { + + private val createTeamHeading = UiSelectorParams(text = "Create a team") + private val profileNameInputField = UiSelectorParams(resourceId = "display-name") + private val teamNameInputField = UiSelectorParams(resourceId = "team-name") + private val organizationSizeDropdown = UiSelectorParams(text = "Please select") + private val firstOrganizationSizeOption = UiSelectorParams(text = "1 - 25") + private val continueButton = UiSelectorParams(text = "Continue") + private val youHaveGotMailHeading = UiSelectorParams(textContains = "got mail") + private val teamCreatedHeading = UiSelectorParams(textContains = "you created a new") + private val closeButton = UiSelector().resourceId("com.android.chrome:id/close_button") + + fun assertCreateTeamPageVisible(): TeamCreationPage { + val heading = UiWaitUtils.waitElement(createTeamHeading, timeout = 15.seconds) + assertTrue("Create a team page is not visible", !heading.visibleBounds.isEmpty) + return this + } + + fun enterEmail(email: String?): TeamCreationPage { + val emailField = device.findObjects(By.clazz("android.widget.EditText"))[0] + emailField.click() + emailField.text = email + return this + } + + fun enterProfileName(name: String?): TeamCreationPage { + val profileNameField = UiWaitUtils.waitElement(profileNameInputField, timeout = 15.seconds) + profileNameField.click() + profileNameField.text = name + return this + } + + fun enterTeamName(teamName: String): TeamCreationPage { + val teamNameField = UiWaitUtils.waitElement(teamNameInputField, timeout = 15.seconds) + teamNameField.click() + teamNameField.text = teamName + return this + } + + fun enterPassword(password: String?): TeamCreationPage { + val passwordField = device.findObjects(By.clazz("android.widget.EditText"))[3] + passwordField.click() + passwordField.text = password + return this + } + + fun enterConfirmPassword(password: String?): TeamCreationPage { + val confirmPasswordField = device.findObjects(By.clazz("android.widget.EditText"))[4] + confirmPasswordField.click() + confirmPasswordField.text = password + return this + } + + fun selectFirstOrganizationSizeOption(): TeamCreationPage { + UiWaitUtils.waitElement(organizationSizeDropdown).click() + UiWaitUtils.waitElement(firstOrganizationSizeOption).click() + return this + } + + fun checkIAcceptTermsAndConditions(): TeamCreationPage { + checkBoxAt(0) + return this + } + + fun checkIAgreeToShareAnonymousUsageData(): TeamCreationPage { + checkBoxAt(1) + return this + } + + fun clickContinueButton(): TeamCreationPage { + val button = UiWaitUtils.waitElement(continueButton) + assertTrue("Continue button is not enabled", button.isEnabled) + button.click() + return this + } + + fun assertYouHaveGotMailPageVisible(): TeamCreationPage { + val heading = UiWaitUtils.waitElement(youHaveGotMailHeading, timeout = 30.seconds) + assertTrue("You've got mail page is not visible", !heading.visibleBounds.isEmpty) + return this + } + + fun enterVerificationCode(code: String): TeamCreationPage { + val codeFields = device.findObjects(By.clazz("android.widget.EditText")) + val codeField = codeFields[0] + codeField.click() + code.forEach { digit -> + device.pressKeyCode(KeyEvent.KEYCODE_0 + digit.digitToInt()) + } + return this + } + + fun assertTeamCreatedPageVisible(): TeamCreationPage { + val heading = UiWaitUtils.waitElement(teamCreatedHeading, timeout = 30.seconds) + assertTrue("Team created page is not visible", !heading.visibleBounds.isEmpty) + return this + } + + fun closeTeamCreatedPage(): TeamCreationPage { + device.findObject(closeButton).click() + return this + } + + private fun checkBoxAt(index: Int) { + val checkbox = device.findObjects(By.clazz("android.widget.CheckBox")).getOrNull(index) + ?: throw AssertionError("Checkbox at index $index not found on Create a team page") + if (!checkbox.isChecked) { + checkbox.click() + } + } +} From eb2da59da0dc2513ae252c7e7d0a90151ddd7d3e Mon Sep 17 00:00:00 2001 From: emmaoke-w Date: Mon, 15 Jun 2026 14:29:31 +0200 Subject: [PATCH 2/2] test: Use deterministic invalid OTP (WPB-26345) --- .../android/tests/core/e2eTests/TeamCreationTest.kt | 3 +-- .../android/tests/core/pages/ConversationListPage.kt | 12 ++---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/TeamCreationTest.kt b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/TeamCreationTest.kt index 7c1148cc9ed..9d5b734f0f5 100644 --- a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/TeamCreationTest.kt +++ b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/e2eTests/TeamCreationTest.kt @@ -28,7 +28,6 @@ import kotlinx.coroutines.runBlocking import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import user.UserClient import user.utils.ClientUser import uiautomatorutils.KeyboardUtils.closeKeyboardIfOpened import uiautomatorutils.UiWaitUtils @@ -394,7 +393,7 @@ class TeamCreationTest : BaseUiTest() { } step("When I enter incorrect OTP on team verification page") { - val incorrectOtp = UserClient.RandomStringGenerator.randomNumeric(6) + val incorrectOtp = "0".repeat(6) pages.teamCreationPage.apply { enterVerificationCode(incorrectOtp) } diff --git a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/ConversationListPage.kt b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/ConversationListPage.kt index 8b59906666c..e090b5d2327 100644 --- a/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/ConversationListPage.kt +++ b/tests/testsCore/src/androidTest/kotlin/com/wire/android/tests/core/pages/ConversationListPage.kt @@ -35,9 +35,7 @@ import kotlin.time.Duration.Companion.seconds data class ConversationListPage(private val device: UiDevice) { private val searchField = UiSelectorParams(description = "Search conversations") - private val userProfileButtonNoPhoto = UiSelectorParams(description = "Your profile") - - private val userProfileButton = UiSelectorParams(resourceId = "User avatar") + private val userProfileButton = UiSelectorParams(description = "Your profile") private val conversationListHeading = UiSelectorParams( textContains = "Conversations" ) @@ -410,13 +408,7 @@ data class ConversationListPage(private val device: UiDevice) { } fun clickUserProfileButton(): ConversationListPage { - val buttonWithPhoto = UiWaitUtils.findElementOrNull(userProfileButton) - if (buttonWithPhoto != null && !buttonWithPhoto.visibleBounds.isEmpty) { - buttonWithPhoto.click() - } else { - val buttonNoPhoto = UiWaitUtils.waitElement(userProfileButtonNoPhoto) - buttonNoPhoto.click() - } + UiWaitUtils.waitElement(userProfileButton).click() return this }