Browse Source

Add prefix `MAESTRO_` to Maestro env variable.

pull/2429/head
Benoit Marty 8 months ago
parent
commit
15728d6b58
  1. 14
      .github/workflows/maestro.yml
  2. 14
      .maestro/README.md
  3. 2
      .maestro/allTests.yaml
  4. 14
      .maestro/scripts/checkEnv.js
  5. 2
      .maestro/tests/account/changeServer.yaml
  6. 6
      .maestro/tests/account/login.yaml
  7. 2
      .maestro/tests/account/logout.yaml
  8. 2
      .maestro/tests/assertions/assertAnalyticsDisplayed.yaml
  9. 2
      .maestro/tests/assertions/assertHomeDisplayed.yaml
  10. 2
      .maestro/tests/assertions/assertInitDisplayed.yaml
  11. 2
      .maestro/tests/assertions/assertLoginDisplayed.yaml
  12. 4
      .maestro/tests/assertions/assertRoomListSynced.yaml
  13. 2
      .maestro/tests/assertions/assertWelcomeScreenDisplayed.yaml
  14. 2
      .maestro/tests/init.yaml
  15. 6
      .maestro/tests/roomList/createAndDeleteDM.yaml
  16. 10
      .maestro/tests/roomList/createAndDeleteRoom.yaml
  17. 6
      .maestro/tests/roomList/roomContextMenu.yaml
  18. 2
      .maestro/tests/roomList/roomList.yaml
  19. 6
      .maestro/tests/roomList/searchRoomList.yaml
  20. 2
      .maestro/tests/roomList/timeline/messages/location.yaml
  21. 2
      .maestro/tests/roomList/timeline/messages/poll.yaml
  22. 2
      .maestro/tests/roomList/timeline/messages/text.yaml
  23. 4
      .maestro/tests/roomList/timeline/timeline.yaml
  24. 2
      .maestro/tests/settings/settings.yaml

14
.github/workflows/maestro.yml

@ -55,10 +55,10 @@ jobs: @@ -55,10 +55,10 @@ jobs:
# app-file should point to an x86 compatible APK file, so upload the x86_64 one (much smaller than the universal APK).
app-file: app/build/outputs/apk/gplay/debug/app-gplay-x86_64-debug.apk
env: |
USERNAME=maestroelement
PASSWORD=${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }}
RECOVERY_KEY=${{ secrets.MATRIX_MAESTRO_ACCOUNT_RECOVERY_KEY }}
ROOM_NAME=MyRoom
INVITEE1_MXID=@maestroelement2:matrix.org
INVITEE2_MXID=@maestroelement3:matrix.org
APP_ID=io.element.android.x.debug
MAESTRO_USERNAME=maestroelement
MAESTRO_PASSWORD=${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }}
MAESTRO_RECOVERY_KEY=${{ secrets.MATRIX_MAESTRO_ACCOUNT_RECOVERY_KEY }}
MAESTRO_ROOM_NAME=MyRoom
MAESTRO_INVITEE1_MXID=@maestroelement2:matrix.org
MAESTRO_INVITEE2_MXID=@maestroelement3:matrix.org
MAESTRO_APP_ID=io.element.android.x.debug

14
.maestro/README.md

@ -22,13 +22,13 @@ From root dir of the project @@ -22,13 +22,13 @@ From root dir of the project
```shell
maestro test \
-e APP_ID=io.element.android.x.debug \
-e USERNAME=user1 \
-e PASSWORD=123 \
-e RECOVERY_KEY=ABC \
-e ROOM_NAME="MyRoom" \
-e INVITEE1_MXID=user2 \
-e INVITEE2_MXID=user3 \
-e MAESTRO_APP_ID=io.element.android.x.debug \
-e MAESTRO_USERNAME=user1 \
-e MAESTRO_PASSWORD=123 \
-e MAESTRO_RECOVERY_KEY=ABC \
-e MAESTRO_ROOM_NAME="MyRoom" \
-e MAESTRO_INVITEE1_MXID=user2 \
-e MAESTRO_INVITEE2_MXID=user3 \
.maestro/allTests.yaml
```

2
.maestro/allTests.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
## Check that all env variables required in the whole test suite are declared (to fail faster)
- runScript: ./scripts/checkEnv.js

14
.maestro/scripts/checkEnv.js

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
// This array contains all the required environment variable. When adding a variable, add it here also.
// If a variable is missing, an error will occur.
if (APP_ID == null) throw "Fatal: missing env variable APP_ID"
if (USERNAME == null) throw "Fatal: missing env variable USERNAME"
if (PASSWORD == null) throw "Fatal: missing env variable PASSWORD"
if (RECOVERY_KEY == null) throw "Fatal: missing env variable RECOVERY_KEY"
if (ROOM_NAME == null) throw "Fatal: missing env variable ROOM_NAME"
if (INVITEE1_MXID == null) throw "Fatal: missing env variable INVITEE1_MXID"
if (INVITEE2_MXID == null) throw "Fatal: missing env variable INVITEE2_MXID"
if (MAESTRO_APP_ID == null) throw "Fatal: missing env variable MAESTRO_APP_ID"
if (MAESTRO_USERNAME == null) throw "Fatal: missing env variable MAESTRO_USERNAME"
if (MAESTRO_PASSWORD == null) throw "Fatal: missing env variable MAESTRO_PASSWORD"
if (MAESTRO_RECOVERY_KEY == null) throw "Fatal: missing env variable MAESTRO_RECOVERY_KEY"
if (MAESTRO_ROOM_NAME == null) throw "Fatal: missing env variable MAESTRO_ROOM_NAME"
if (MAESTRO_INVITEE1_MXID == null) throw "Fatal: missing env variable MAESTRO_INVITEE1_MXID"
if (MAESTRO_INVITEE2_MXID == null) throw "Fatal: missing env variable MAESTRO_INVITEE2_MXID"

2
.maestro/tests/account/changeServer.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- tapOn:
id: "login-change_server"

6
.maestro/tests/account/login.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- tapOn: "Continue"
- runFlow: ../assertions/assertLoginDisplayed.yaml
@ -9,7 +9,7 @@ appId: ${APP_ID} @@ -9,7 +9,7 @@ appId: ${APP_ID}
id: "login-continue"
- tapOn:
id: "login-email_username"
- inputText: ${USERNAME}
- inputText: ${MAESTRO_USERNAME}
- pressKey: Enter
- tapOn:
id: "login-password"
@ -20,7 +20,7 @@ appId: ${APP_ID} @@ -20,7 +20,7 @@ appId: ${APP_ID}
- tapOn:
id: "login-password"
- eraseText: 20
- inputText: ${PASSWORD}
- inputText: ${MAESTRO_PASSWORD}
- pressKey: Enter
- tapOn: "Continue"
- runFlow: ../assertions/assertWelcomeScreenDisplayed.yaml

2
.maestro/tests/account/logout.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- tapOn:
id: "home_screen-settings"

2
.maestro/tests/assertions/assertAnalyticsDisplayed.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- extendedWaitUntil:
visible: "Help improve Element X dbg"

2
.maestro/tests/assertions/assertHomeDisplayed.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- extendedWaitUntil:
visible: "All Chats"

2
.maestro/tests/assertions/assertInitDisplayed.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- extendedWaitUntil:
visible: "Be in your element"

2
.maestro/tests/assertions/assertLoginDisplayed.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- extendedWaitUntil:
visible: "Change account provider"

4
.maestro/tests/assertions/assertRoomListSynced.yaml

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- extendedWaitUntil:
visible: ${ROOM_NAME}
visible: ${MAESTRO_ROOM_NAME}
timeout: 10000

2
.maestro/tests/assertions/assertWelcomeScreenDisplayed.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- extendedWaitUntil:
visible:

2
.maestro/tests/init.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- clearState
- launchApp:

6
.maestro/tests/roomList/createAndDeleteDM.yaml

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
appId: ${APP_ID}
appId: ${MAESTRO_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}
- inputText: ${MAESTRO_INVITEE1_MXID}
- tapOn:
text: ${INVITEE1_MXID}
text: ${MAESTRO_INVITEE1_MXID}
index: 1
- takeScreenshot: build/maestro/330-createAndDeleteDM
- tapOn: "maestroelement2"

10
.maestro/tests/roomList/createAndDeleteRoom.yaml

@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
appId: ${APP_ID}
appId: ${MAESTRO_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}
- inputText: ${MAESTRO_INVITEE1_MXID}
- tapOn:
text: ${INVITEE1_MXID}
text: ${MAESTRO_INVITEE1_MXID}
index: 1
- tapOn: "Next"
- tapOn: "e.g. your project name"
@ -19,9 +19,9 @@ appId: ${APP_ID} @@ -19,9 +19,9 @@ appId: ${APP_ID}
- tapOn: "Invite people"
# assert there's 1 member and 1 invitee
- tapOn: "Search for someone"
- inputText: ${INVITEE2_MXID}
- inputText: ${MAESTRO_INVITEE2_MXID}
- tapOn:
text: ${INVITEE2_MXID}
text: ${MAESTRO_INVITEE2_MXID}
index: 1
- tapOn: "Invite"
- tapOn: "Back"

6
.maestro/tests/roomList/roomContextMenu.yaml

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
# Purpose: Test the context menu of a room in the room list
- longPressOn: ${ROOM_NAME}
- longPressOn: ${MAESTRO_ROOM_NAME}
- takeScreenshot: build/maestro/310-RoomList-ContextMenu
- tapOn:
text: "Settings"
index: 0
- tapOn: "Back"
- longPressOn: ${ROOM_NAME}
- longPressOn: ${MAESTRO_ROOM_NAME}
- tapOn:
text: "Leave room"
index: 0

2
.maestro/tests/roomList/roomList.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- runFlow: searchRoomList.yaml
- takeScreenshot: build/maestro/300-RoomList

6
.maestro/tests/roomList/searchRoomList.yaml

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- runFlow: ../assertions/assertRoomListSynced.yaml
- tapOn: "search"
- inputText: ${ROOM_NAME.substring(0, 3)}
- inputText: ${MAESTRO_ROOM_NAME.substring(0, 3)}
- takeScreenshot: build/maestro/400-SearchRoom
- tapOn: ${ROOM_NAME}
- tapOn: ${MAESTRO_ROOM_NAME}
# Back from timeline
- back
- assertVisible: "MyR"

2
.maestro/tests/roomList/timeline/messages/location.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- takeScreenshot: build/maestro/520-Timeline
- tapOn: "Add attachment"

2
.maestro/tests/roomList/timeline/messages/poll.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- takeScreenshot: build/maestro/530-Timeline
- tapOn: "Add attachment"

2
.maestro/tests/roomList/timeline/messages/text.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- takeScreenshot: build/maestro/510-Timeline
- tapOn:

4
.maestro/tests/roomList/timeline/timeline.yaml

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
# This is the name of one room
- tapOn: ${ROOM_NAME}
- tapOn: ${MAESTRO_ROOM_NAME}
- takeScreenshot: build/maestro/500-Timeline
- runFlow: messages/text.yaml
- runFlow: messages/location.yaml

2
.maestro/tests/settings/settings.yaml

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
appId: ${APP_ID}
appId: ${MAESTRO_APP_ID}
---
- tapOn:
id: "home_screen-settings"

Loading…
Cancel
Save