Files
spacedrive/apps/mobile/scripts/run-maestro-tests
Utku 1634f24808 [MOB-1] Theme support for Mobile (#755)
* revert rspc changes and some theme stuff

* Run onboarding test first

* test adding a tag

* handle keyboard on Create Tag Modal

* listen system theme changes

* fix delete tag button

* wait add tag mutation

* remove duplicate assert

* fix edit location setting screen

* select theme & fix add tag test

* add how to run web app to contributing

* add note about how to use stores correctly

* use theme colors

* system theme

* remove metro-minify-terser

* final tweaks

* cleanup

* cleanup

---------

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2023-05-04 08:10:31 +00:00

77 lines
1.6 KiB
Bash

#!/bin/bash
trap 'exit' INT
PLATFORM=${1:-}
case $PLATFORM in
ios | android )
;;
*)
echo "Error! You must pass either 'android' or 'ios'"
echo ""
exit 1
;;
esac
# NOTE: This script is intended to be run from the root of the project (CI)
if [ "$PLATFORM" == "ios" ]; then
testFiles=$(ls apps/mobile/tests/*.yml apps/mobile/tests/ios-only/*.yml)
else
testFiles=$(ls apps/mobile/tests/*.yml apps/mobile/tests/android-only/*.yml)
fi
# Run onboarding first
onboardingFile="apps/mobile/tests/onboarding.yml"
if ! maestro test "$onboardingFile"
then
echo "Onboarding test failed. Retrying in 30 seconds..."
sleep 30
if ! maestro test "$onboardingFile"
then
echo "Onboarding test failed again. Retrying for the last time in 120 seconds..."
sleep 120
if ! maestro test "$onboardingFile"
then
echo "Onboarding test failed again. Exiting..."
exit 1
fi
fi
fi
failedTests=()
# Run the rest of the files
for file in $testFiles
do
# Skip onboarding.yml since it has already been run
if [ "$file" == "$onboardingFile" ]
then
continue
fi
if ! maestro test "$file"
then
echo "Test ${file} failed. Retrying in 30 seconds..."
sleep 30
if ! maestro test "$file"
then
echo "Test ${file} failed again. Retrying for the last time in 120 seconds..."
sleep 120
if ! maestro test "$file"
then
failedTests+=("$file")
fi
fi
fi
done
if [ ${#failedTests[@]} -eq 0 ]; then
exit 0
else
echo "These tests failed:"
printf '%s\n' "${failedTests[@]}"
exit 1
fi