Create maestro runner and some test commands

This commit is contained in:
Diego Mello 2023-06-06 16:01:10 -03:00
parent 2d07b1682c
commit 663a3c8551
6 changed files with 72 additions and 2 deletions

3
.gitignore vendored
View File

@ -45,6 +45,7 @@ npm-debug.log
yarn-error.log yarn-error.log
coverage/ coverage/
maestro/results/
# fastlane # fastlane
# #
@ -58,8 +59,6 @@ coverage/
**/fastlane/screenshots **/fastlane/screenshots
**/fastlane/test_output **/fastlane/test_output
coverage
artifacts artifacts
.vscode/ .vscode/
e2e/e2e_account.ts e2e/e2e_account.ts

12
maestro/clear_cache.yml Normal file
View File

@ -0,0 +1,12 @@
# After logged in, go to settings and clear cache
appId: chat.rocket.reactnative
---
- launchApp
- tapOn:
id: 'rooms-list-view-sidebar'
- tapOn: 'Settings'
- tapOn: 'Clear local server cache'
- assertVisible: 'This will clear all your offline data.'
- tapOn: 'CLEAR'
- assertVisible:
text: 'support'

View File

@ -0,0 +1,24 @@
if [ -z "$1" ] || [ -z "$2" ]
then
echo "sh ./flashlight-runner.sh <bundleId> <testCommand> <duration(optional)>"
exit 1
fi
# removes .yml from the test command
TEST_COMMAND="${2/.yml}"
# creates the results folder if it doesn't exist
mkdir -p ./results/$TEST_COMMAND
# updates the bundleId in the test file
sed -i '' "s/appId: .*/appId: $1/g" $2
DURATION=$3
# if no duration, don't use it
if [ -z "$3" ]
then
DURATION=0
fi
# runs the test
flashlight test --bundleId $1 --testCommand "maestro test $2" --resultsTitle "$TEST_COMMAND, $1" --resultsFilePath "./results/$TEST_COMMAND/$1.json" --record --duration $DURATION

21
maestro/login.yml Normal file
View File

@ -0,0 +1,21 @@
# Replace env first
appId: chat.rocket.android
env:
USERNAME: USERNAME
PASSWORD: PASSWORD # can be flaky on some Android devices
---
- launchApp:
clearState: true
- tapOn:
id: 'new-server-view-input'
- inputText: 'open'
- pressKey: 'Enter'
- tapOn: 'Login'
- tapOn:
id: 'login-view-email'
- inputText: ${USERNAME}
- pressKey: 'enter'
- inputText: ${PASSWORD}
- pressKey: 'enter'
- assertVisible:
id: 'listheader-encryption'

View File

@ -0,0 +1,10 @@
appId: chat.rocket.android
---
- launchApp
- tapOn: 'support'
- repeat:
times: 10
commands:
- swipe:
direction: 'down'
duration: 100

4
maestro/tti.yml Normal file
View File

@ -0,0 +1,4 @@
appId: chat.rocket.android
---
- launchApp
- assertVisible: 'Beyond Team Collaboration'