From 03f3e8b3e08f7987686c2a59ddc821dde5c4d556 Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Wed, 15 Jul 2026 10:56:50 +0200 Subject: [PATCH] Try fixing DM creation in Maestro (#7204) * Try fixing DM creation in Maestro * Also handle 'invite new people to this room' with first invite to aRoomName * Try adding a room list clean up sub-flow * No need to press back button after successful invites * Looks like 'hideKeyboard' works as 'back' and messes up with the navigation. Try using the workaround described in https://docs.maestro.dev/reference/commands-available/hidekeyboard#workarounds --- .maestro/tests/roomList/cleanUpRoomList.yaml | 21 +++++++++++++++++++ .../tests/roomList/createAndDeleteDM.yaml | 11 +++++++++- .../tests/roomList/createAndDeleteRoom.yaml | 14 +++++++++---- .maestro/tests/roomList/roomList.yaml | 1 + .../invitepeople/impl/InvitePeopleView.kt | 4 ++-- 5 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 .maestro/tests/roomList/cleanUpRoomList.yaml diff --git a/.maestro/tests/roomList/cleanUpRoomList.yaml b/.maestro/tests/roomList/cleanUpRoomList.yaml new file mode 100644 index 0000000000..3d9fb3d6e4 --- /dev/null +++ b/.maestro/tests/roomList/cleanUpRoomList.yaml @@ -0,0 +1,21 @@ +appId: ${MAESTRO_APP_ID} +--- +# Clean up the room list if it was left in a bad state by previous tests +- runFlow: + when: + visible: 'aRoomName' + commands: + - longPressOn: 'aRoomName' + - tapOn: + text: "Leave room" + index: 0 + - tapOn: "Leave" +- runFlow: + when: + visible: ${MAESTRO_INVITEE1_MXID} + commands: + - longPressOn: ${MAESTRO_INVITEE1_MXID} + - tapOn: + text: "Leave room" + index: 0 + - tapOn: "Leave" diff --git a/.maestro/tests/roomList/createAndDeleteDM.yaml b/.maestro/tests/roomList/createAndDeleteDM.yaml index eed576c04f..8372d6dbc9 100644 --- a/.maestro/tests/roomList/createAndDeleteDM.yaml +++ b/.maestro/tests/roomList/createAndDeleteDM.yaml @@ -7,7 +7,16 @@ appId: ${MAESTRO_APP_ID} - tapOn: text: ${MAESTRO_INVITEE1_MXID} index: 1 -- tapOn: "Continue" +- runFlow: + when: + visible: 'Start a chat with this new contact?' + commands: + - tapOn: 'Continue' +- runFlow: + when: + visible: 'Send invite?' + commands: + - tapOn: 'Send invite' - takeScreenshot: build/maestro/330-createAndDeleteDM - tapOn: "maestroelement2" - scroll diff --git a/.maestro/tests/roomList/createAndDeleteRoom.yaml b/.maestro/tests/roomList/createAndDeleteRoom.yaml index adf9d7cf29..6b4d745fae 100644 --- a/.maestro/tests/roomList/createAndDeleteRoom.yaml +++ b/.maestro/tests/roomList/createAndDeleteRoom.yaml @@ -15,6 +15,12 @@ appId: ${MAESTRO_APP_ID} text: ${MAESTRO_INVITEE1_MXID} index: 1 - tapOn: "Finish" +- runFlow: + when: + visible: 'Invite new contact to this room?' + commands: + - tapOn: + id: "confirm_invite_unknown" - tapOn: "aRoomName" - tapOn: "Invite" # assert there's 1 member and 1 invitee @@ -23,6 +29,10 @@ appId: ${MAESTRO_APP_ID} - tapOn: text: ${MAESTRO_INVITEE2_MXID} index: 1 +# Hide keyboard by tapping on an external element in case it's displayed, otherwise it will 'eat' the back button press +- tapOn: + # Navigation title + text: "Invite people" - tapOn: "Invite" - runFlow: when: @@ -30,10 +40,6 @@ appId: ${MAESTRO_APP_ID} commands: - tapOn: id: "confirm_invite_unknown" -# Close the keyboard if it's still open -- tapOn: "Back" -# Go back to the room details screen -- tapOn: "Back" - scrollUntilVisible: direction: DOWN element: diff --git a/.maestro/tests/roomList/roomList.yaml b/.maestro/tests/roomList/roomList.yaml index 5cc9e269c5..704d983b7d 100644 --- a/.maestro/tests/roomList/roomList.yaml +++ b/.maestro/tests/roomList/roomList.yaml @@ -1,5 +1,6 @@ appId: ${MAESTRO_APP_ID} --- +- runFlow: cleanUpRoomList.yaml - runFlow: searchRoomList.yaml - takeScreenshot: build/maestro/300-RoomList - runFlow: timeline/timeline.yaml diff --git a/features/invitepeople/impl/src/main/kotlin/io/element/android/features/invitepeople/impl/InvitePeopleView.kt b/features/invitepeople/impl/src/main/kotlin/io/element/android/features/invitepeople/impl/InvitePeopleView.kt index 2bbd64c977..0ee3559aa3 100644 --- a/features/invitepeople/impl/src/main/kotlin/io/element/android/features/invitepeople/impl/InvitePeopleView.kt +++ b/features/invitepeople/impl/src/main/kotlin/io/element/android/features/invitepeople/impl/InvitePeopleView.kt @@ -302,13 +302,13 @@ private fun InvitePeopleConfirmModal( text = stringResource(CommonStrings.action_remove), onClick = onRemove, leadingIcon = IconSource.Vector(CompoundIcons.Close()), - modifier = Modifier.weight(1f).testTag(TestTags.confirmInviteUnknown), + modifier = Modifier.weight(1f), ) Button( text = stringResource(CommonStrings.action_invite), onClick = onInvite, leadingIcon = IconSource.Vector(CompoundIcons.Check()), - modifier = Modifier.weight(1f) + modifier = Modifier.weight(1f).testTag(TestTags.confirmInviteUnknown), ) } }