diff --git a/.gitignore b/.gitignore index e0b14f36a..decdbdb37 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ npm-debug.log yarn-error.log coverage/ +maestro/results/ # fastlane # @@ -58,8 +59,6 @@ coverage/ **/fastlane/screenshots **/fastlane/test_output -coverage - artifacts .vscode/ e2e/e2e_account.ts diff --git a/maestro/clear_cache.yml b/maestro/clear_cache.yml new file mode 100644 index 000000000..17f12bd81 --- /dev/null +++ b/maestro/clear_cache.yml @@ -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' diff --git a/maestro/flashlight-runner.sh b/maestro/flashlight-runner.sh new file mode 100644 index 000000000..6f8ccfa6a --- /dev/null +++ b/maestro/flashlight-runner.sh @@ -0,0 +1,24 @@ +if [ -z "$1" ] || [ -z "$2" ] + then + echo "sh ./flashlight-runner.sh " + 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 \ No newline at end of file diff --git a/maestro/login.yml b/maestro/login.yml new file mode 100644 index 000000000..69e26bdcc --- /dev/null +++ b/maestro/login.yml @@ -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' diff --git a/maestro/scroll_messages.yml b/maestro/scroll_messages.yml new file mode 100644 index 000000000..d34e73b30 --- /dev/null +++ b/maestro/scroll_messages.yml @@ -0,0 +1,10 @@ +appId: chat.rocket.android +--- +- launchApp +- tapOn: 'support' +- repeat: + times: 10 + commands: + - swipe: + direction: 'down' + duration: 100 diff --git a/maestro/tti.yml b/maestro/tti.yml new file mode 100644 index 000000000..fe64f7336 --- /dev/null +++ b/maestro/tti.yml @@ -0,0 +1,4 @@ +appId: chat.rocket.android +--- +- launchApp +- assertVisible: 'Beyond Team Collaboration'