From 38ecac7b5990511c3b00bc1937e9f199a7d07cd5 Mon Sep 17 00:00:00 2001 From: Marco Romano Date: Tue, 4 Jul 2023 13:33:59 +0200 Subject: [PATCH] Add Maestro tests for create & join rooms (#472) I created 2 additional test users to use them as MXID we lookup during room creation. I.e. we will not login as those users, it's just 2 known MXIDs that we know exist so we can look them up. - https://github.com/vector-im/element-x-android/issues/409 --- .github/workflows/maestro.yml | 2 ++ .maestro/README.md | 4 ++- .../tests/roomList/createAndDeleteDM.yaml | 13 ++++++++ .../tests/roomList/createAndDeleteRoom.yaml | 33 +++++++++++++++++++ .maestro/tests/roomList/roomContextMenu.yaml | 14 ++++++++ .maestro/tests/roomList/roomList.yaml | 6 ++-- 6 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 .maestro/tests/roomList/createAndDeleteDM.yaml create mode 100644 .maestro/tests/roomList/createAndDeleteRoom.yaml create mode 100644 .maestro/tests/roomList/roomContextMenu.yaml diff --git a/.github/workflows/maestro.yml b/.github/workflows/maestro.yml index e131315720..389feb0665 100644 --- a/.github/workflows/maestro.yml +++ b/.github/workflows/maestro.yml @@ -50,4 +50,6 @@ jobs: USERNAME=maestroelement PASSWORD=${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }} ROOM_NAME=MyRoom + INVITEE1_MXID=@maestroelement2:matrix.org + INVITEE2_MXID=@maestroelement3:matrix.org APP_ID=io.element.android.x.debug diff --git a/.maestro/README.md b/.maestro/README.md index 3926dcdf56..cd1f0658a7 100644 --- a/.maestro/README.md +++ b/.maestro/README.md @@ -23,9 +23,11 @@ From root dir of the project ```shell maestro test \ -e APP_ID=io.element.android.x.debug \ - -e USERNAME=user \ + -e USERNAME=user1 \ -e PASSWORD=123 \ -e ROOM_NAME="MyRoom" \ + -e INVITEE1_MXID=user2 \ + -e INVITEE2_MXID=user3 \ .maestro/allTests.yaml ``` diff --git a/.maestro/tests/roomList/createAndDeleteDM.yaml b/.maestro/tests/roomList/createAndDeleteDM.yaml new file mode 100644 index 0000000000..f79a7418e4 --- /dev/null +++ b/.maestro/tests/roomList/createAndDeleteDM.yaml @@ -0,0 +1,13 @@ +appId: ${APP_ID} +--- +# Purpose: Test the creation and deletion of a DM room. +- tapOn: "Create a new conversation or room" +- tapOn: "Search for someone" +- inputText: ${INVITEE1_MXID} +- tapOn: + text: ${INVITEE1_MXID} + index: 1 +- takeScreenshot: build/maestro/330-createAndDeleteDM +- tapOn: "maestroelement2" +- tapOn: "Leave room" +- tapOn: "Leave" diff --git a/.maestro/tests/roomList/createAndDeleteRoom.yaml b/.maestro/tests/roomList/createAndDeleteRoom.yaml new file mode 100644 index 0000000000..b2b7c1da0b --- /dev/null +++ b/.maestro/tests/roomList/createAndDeleteRoom.yaml @@ -0,0 +1,33 @@ +appId: ${APP_ID} +--- +# Purpose: Test the creation and deletion of a room +- tapOn: "Create a new conversation or room" +- tapOn: "New room" +- tapOn: "Search for someone" +- inputText: ${INVITEE1_MXID} +- tapOn: + text: ${INVITEE1_MXID} + index: 1 +- tapOn: "Next" +- tapOn: "e.g. your project name" +- inputText: "aRoomName" +- tapOn: "What is this room about?" +- inputText: "aRoomTopic" +- tapOn: "Create" +- takeScreenshot: build/maestro/320-createAndDeleteRoom +- tapOn: "aRoomName" +- tapOn: "Invite people" +# assert there's 1 memeber and 1 invitee +- tapOn: "Search for someone" +- inputText: ${INVITEE2_MXID} +- tapOn: + text: ${INVITEE2_MXID} + index: 1 +- tapOn: "Send" +- tapOn: "Back" +- tapOn: "aRoomName" +- tapOn: "People" +# assert there's 1 memeber and 2 invitees +- tapOn: "Back" +- tapOn: "Leave room" +- tapOn: "Leave" diff --git a/.maestro/tests/roomList/roomContextMenu.yaml b/.maestro/tests/roomList/roomContextMenu.yaml new file mode 100644 index 0000000000..c2a8764558 --- /dev/null +++ b/.maestro/tests/roomList/roomContextMenu.yaml @@ -0,0 +1,14 @@ +appId: ${APP_ID} +--- +# Purpose: Test the context menu of a room in the room list +- longPressOn: ${ROOM_NAME} +- takeScreenshot: build/maestro/310-RoomList-ContextMenu +- tapOn: + text: "Settings" + index: 0 +- tapOn: "Back" +- longPressOn: ${ROOM_NAME} +- tapOn: + text: "Leave room" + index: 0 +- tapOn: "Cancel" diff --git a/.maestro/tests/roomList/roomList.yaml b/.maestro/tests/roomList/roomList.yaml index 3a26048791..6365759e72 100644 --- a/.maestro/tests/roomList/roomList.yaml +++ b/.maestro/tests/roomList/roomList.yaml @@ -1,6 +1,8 @@ appId: ${APP_ID} --- -- takeScreenshot: build/maestro/300-RoomList - runFlow: searchRoomList.yaml +- takeScreenshot: build/maestro/300-RoomList - runFlow: timeline/timeline.yaml - +- runFlow: roomContextMenu.yaml +- runFlow: createAndDeleteRoom.yaml +- runFlow: createAndDeleteDM.yaml