forked from stripe/stripe-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update maestro scripts with retries (stripe#7169)
- Loading branch information
1 parent
9ef6ea0
commit a3427e4
Showing
4 changed files
with
51 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
set -o pipefail | ||
set -x | ||
|
||
# Retry mechanism for Maestro installation | ||
MAX_RETRIES=3 | ||
RETRY_COUNT=0 | ||
|
||
# Get the first command line argument as the parameter, one of [customersheet, paymentsheet] | ||
elementType=$1 | ||
|
||
now=$(date +%F_%H-%M-%S) | ||
echo $now | ||
|
||
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do | ||
export MAESTRO_VERSION=1.30.4 | ||
curl -Ls "https://get.maestro.mobile.dev" | bash | ||
|
||
if [ $? -eq 0 ]; then | ||
# If successful, set PATH and break loop | ||
export PATH="$PATH":"$HOME/.maestro/bin" | ||
maestro -v | ||
break | ||
else | ||
let RETRY_COUNT=RETRY_COUNT+1 | ||
echo "Attempt $RETRY_COUNT failed. Retrying..." | ||
sleep 5 | ||
fi | ||
done | ||
|
||
if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then | ||
echo "Failed to download and install Maestro after $MAX_RETRIES attempts." | ||
exit 1 | ||
fi | ||
|
||
# Create test results folder. | ||
mkdir -p /tmp/test_results | ||
|
||
# Compile and install APK. | ||
./gradlew :paymentsheet-example:installDebug | ||
|
||
# Clear and start collecting logs | ||
maestro test --format junit --output maestroReport.xml maestro/$elementType |
This file was deleted.
Oops, something went wrong.