From 4c214db5c49675c810b3e59fc90bedcd07b8184d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 9 Jun 2023 10:17:30 +0200 Subject: [PATCH] Update maestro test regarding the new login flow. --- .maestro/README.md | 2 +- .maestro/tests/account/changeServer.yaml | 13 ++++++++++++- .maestro/tests/account/login.yaml | 2 ++ .maestro/tests/assertions/assertLoginDisplayed.yaml | 2 +- .../impl/accountprovider/AccountProviderView.kt | 3 ++- .../form/ChangeAccountProviderFormView.kt | 5 ++++- .../element/android/libraries/testtags/TestTags.kt | 1 - 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.maestro/README.md b/.maestro/README.md index 76268e144e..3926dcdf56 100644 --- a/.maestro/README.md +++ b/.maestro/README.md @@ -25,7 +25,7 @@ maestro test \ -e APP_ID=io.element.android.x.debug \ -e USERNAME=user \ -e PASSWORD=123 \ - -e ROOM_NAME="my room" \ + -e ROOM_NAME="MyRoom" \ .maestro/allTests.yaml ``` diff --git a/.maestro/tests/account/changeServer.yaml b/.maestro/tests/account/changeServer.yaml index 505a12d2e1..df4b12f253 100644 --- a/.maestro/tests/account/changeServer.yaml +++ b/.maestro/tests/account/changeServer.yaml @@ -3,4 +3,15 @@ appId: ${APP_ID} - tapOn: id: "login-change_server" - takeScreenshot: build/maestro/200-ChangeServer -- tapOn: "Continue" +- tapOn: "matrix.org" +- tapOn: + id: "login-change_server" +- tapOn: "Other" +- tapOn: + id: "change_server-server" +- inputText: "element" +- hideKeyboard +- tapOn: "element.io" +- tapOn: "Cancel" +- back +- back diff --git a/.maestro/tests/account/login.yaml b/.maestro/tests/account/login.yaml index 845746a76b..728ff98b31 100644 --- a/.maestro/tests/account/login.yaml +++ b/.maestro/tests/account/login.yaml @@ -5,6 +5,8 @@ appId: ${APP_ID} - takeScreenshot: build/maestro/100-SignIn - runFlow: changeServer.yaml - runFlow: ../assertions/assertLoginDisplayed.yaml +- tapOn: + id: "login-continue" - tapOn: id: "login-email_username" - inputText: ${USERNAME} diff --git a/.maestro/tests/assertions/assertLoginDisplayed.yaml b/.maestro/tests/assertions/assertLoginDisplayed.yaml index 41f1ff3306..3abd86ceef 100644 --- a/.maestro/tests/assertions/assertLoginDisplayed.yaml +++ b/.maestro/tests/assertions/assertLoginDisplayed.yaml @@ -1,5 +1,5 @@ appId: ${APP_ID} --- - extendedWaitUntil: - visible: "Welcome back!" + visible: "Change account provider" timeout: 10_000 diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt index 56ea41a3d9..5c0ba23ab5 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt @@ -94,7 +94,7 @@ fun AccountProviderView( enabled = state.submitEnabled, modifier = Modifier .fillMaxWidth() - .testTag(TestTags.changeServerContinue) + .testTag(TestTags.loginContinue) ) TextButton( onClick = { @@ -103,6 +103,7 @@ fun AccountProviderView( enabled = true, modifier = Modifier .fillMaxWidth() + .testTag(TestTags.loginChangeServer) ) { Text(text = stringResource(id = R.string.screen_account_provider_change)) } diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/changeaccountprovider/form/ChangeAccountProviderFormView.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/changeaccountprovider/form/ChangeAccountProviderFormView.kt index cb35774147..8ab0659d7b 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/changeaccountprovider/form/ChangeAccountProviderFormView.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/changeaccountprovider/form/ChangeAccountProviderFormView.kt @@ -65,6 +65,8 @@ import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.IconButton import io.element.android.libraries.designsystem.theme.components.OutlinedTextField import io.element.android.libraries.designsystem.theme.components.Text +import io.element.android.libraries.testtags.TestTags +import io.element.android.libraries.testtags.testTag /** * https://www.figma.com/file/o9p34zmiuEpZRyvZXJZAYL/FTUE?type=design&node-id=611-61435 @@ -117,7 +119,8 @@ fun ChangeAccountProviderFormView( // readOnly = isLoading, modifier = Modifier .fillMaxWidth() - .padding(start = 16.dp, end = 16.dp, bottom = 30.dp), + .padding(start = 16.dp, end = 16.dp, bottom = 30.dp) + .testTag(TestTags.changeServerServer), onValueChange = { userInputState = it eventSink(ChangeAccountProviderFormEvents.UserInput(it)) diff --git a/libraries/testtags/src/main/kotlin/io/element/android/libraries/testtags/TestTags.kt b/libraries/testtags/src/main/kotlin/io/element/android/libraries/testtags/TestTags.kt index df12c755e3..d702c797a8 100644 --- a/libraries/testtags/src/main/kotlin/io/element/android/libraries/testtags/TestTags.kt +++ b/libraries/testtags/src/main/kotlin/io/element/android/libraries/testtags/TestTags.kt @@ -37,7 +37,6 @@ object TestTags { * Change server screen. */ val changeServerServer = TestTag("change_server-server") - val changeServerContinue = TestTag("change_server-continue") /** * Room list / Home screen.