Browse Source

Update maestro test regarding the new login flow.

feature/fga/small_timeline_improvements
Benoit Marty 1 year ago committed by Benoit Marty
parent
commit
4266faa204
  1. 2
      .maestro/README.md
  2. 13
      .maestro/tests/account/changeServer.yaml
  3. 2
      .maestro/tests/account/login.yaml
  4. 2
      .maestro/tests/assertions/assertLoginDisplayed.yaml
  5. 3
      features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt
  6. 5
      features/login/impl/src/main/kotlin/io/element/android/features/login/impl/changeaccountprovider/form/ChangeAccountProviderFormView.kt
  7. 1
      libraries/testtags/src/main/kotlin/io/element/android/libraries/testtags/TestTags.kt

2
.maestro/README.md

@ -25,7 +25,7 @@ maestro test \ @@ -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
```

13
.maestro/tests/account/changeServer.yaml

@ -3,4 +3,15 @@ appId: ${APP_ID} @@ -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

2
.maestro/tests/account/login.yaml

@ -5,6 +5,8 @@ appId: ${APP_ID} @@ -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}

2
.maestro/tests/assertions/assertLoginDisplayed.yaml

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
appId: ${APP_ID}
---
- extendedWaitUntil:
visible: "Welcome back!"
visible: "Change account provider"
timeout: 10_000

3
features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt

@ -94,7 +94,7 @@ fun AccountProviderView( @@ -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( @@ -103,6 +103,7 @@ fun AccountProviderView(
enabled = true,
modifier = Modifier
.fillMaxWidth()
.testTag(TestTags.loginChangeServer)
) {
Text(text = stringResource(id = R.string.screen_account_provider_change))
}

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

1
libraries/testtags/src/main/kotlin/io/element/android/libraries/testtags/TestTags.kt

@ -37,7 +37,6 @@ object TestTags { @@ -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.

Loading…
Cancel
Save