freshyo/tests/e2e/regions/run.sh
2026-10-05 11:46:47 +05:30

41 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
if [ ! -f .env ]; then
echo "Missing tests/e2e/regions/.env — copy .env.example to .env and fill it in." >&2
exit 1
fi
while IFS= read -r line || [ -n "$line" ]; do
line="${line%$'\r'}"
case "$line" in
'' | '#'*) continue ;;
esac
export "$line"
done < ./.env
: "${USER_APP_ID:?USER_APP_ID is required}"
: "${ADMIN_APP_ID:?ADMIN_APP_ID is required}"
: "${USER_MOBILE:?USER_MOBILE is required}"
: "${USER_PASSWORD:?USER_PASSWORD is required}"
: "${STAFF_NAME:?STAFF_NAME is required}"
: "${STAFF_PASSWORD:?STAFF_PASSWORD is required}"
if [ "$#" -eq 0 ]; then
set -- .
fi
maestro test \
-e USER_APP_ID="$USER_APP_ID" \
-e ADMIN_APP_ID="$ADMIN_APP_ID" \
-e USER_MOBILE="$USER_MOBILE" \
-e USER_PASSWORD="$USER_PASSWORD" \
-e STAFF_NAME="$STAFF_NAME" \
-e STAFF_PASSWORD="$STAFF_PASSWORD" \
-e GATE_REGION_NAME="${GATE_REGION_NAME:-Mahabubnagar}" \
-e ADDRESS_LABEL="${ADDRESS_LABEL:-}" \
-e PRODUCT_NAME="${PRODUCT_NAME:-}" \
-e EXPECT_VISIBLE="${EXPECT_VISIBLE:-true}" \
-e NEW_DELIVERY_CHARGE="${NEW_DELIVERY_CHARGE:-18}" \
"$@"