maestro cases

This commit is contained in:
2026-03-02 19:18:35 +05:30
parent 07a0a29106
commit c0a69707e6
46 changed files with 1108 additions and 89 deletions

View File

@@ -1,6 +1,6 @@
# --- Mobile App Development ---
.PHONY: mobile-install mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart test-e2e test-e2e-setup test-e2e-client test-e2e-staff
.PHONY: mobile-install mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart test-e2e test-e2e-setup test-e2e-client test-e2e-staff test-e2e-staff-auth test-e2e-staff-navigation test-e2e-staff-profile test-e2e-staff-profile-extended test-e2e-staff-shifts test-e2e-staff-compliance test-e2e-staff-home test-e2e-staff-sign-out test-e2e-client-auth test-e2e-client-navigation test-e2e-client-orders test-e2e-client-settings test-e2e-client-sign-out
MOBILE_DIR := apps/mobile
@@ -72,29 +72,184 @@ mobile-staff-build: dataconnect-generate-sdk
# --- E2E (Maestro) ---
# Set env before running: TEST_CLIENT_EMAIL, TEST_CLIENT_PASSWORD, TEST_CLIENT_COMPANY, TEST_STAFF_PHONE, TEST_STAFF_OTP, TEST_STAFF_SIGNUP_PHONE
# Example: export TEST_CLIENT_EMAIL=legendary@krowd.com TEST_CLIENT_PASSWORD=Demo2026!
# Example: export TEST_STAFF_PHONE=5557654321 TEST_STAFF_OTP=123456
# Client: testclient@gmail.com / testclient!
# Staff: TEST_STAFF_PHONE=5555551234 TEST_STAFF_OTP=123123 (+1 555-555-1234 in Firebase)
test-e2e-setup:
@echo "--> Checking Maestro CLI..."
@maestro --version
@echo "--> Maestro OK. Ensure apps are built & installed (see docs/research/maestro-test-run-instructions.md)"
# Maestro runs flows in parallel by default; --shard-split=1 forces sequential (avoids tcp:7001 closed)
# Note: -s/--shards is deprecated, use --shard-split instead
MAESTRO_SHARDS ?= --shard-split=1
test-e2e: test-e2e-setup
@echo "--> Running full E2E suite (Client + Staff auth flows)..."
@maestro test apps/mobile/apps/client/maestro/auth/sign_in.yaml apps/mobile/apps/client/maestro/auth/sign_up.yaml \
apps/mobile/apps/staff/maestro/auth/sign_in.yaml apps/mobile/apps/staff/maestro/auth/sign_up.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}" \
@echo "--> Running full E2E suite (Client + Staff auth + negative auth flows)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml apps/mobile/apps/client/maestro/auth/sign_up.yaml apps/mobile/apps/client/maestro/auth/sign_in_invalid_password.yaml \
apps/mobile/apps/staff/maestro/auth/sign_in.yaml apps/mobile/apps/staff/maestro/auth/sign_up.yaml apps/mobile/apps/staff/maestro/auth/sign_in_invalid_otp.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}" -e TEST_CLIENT_INVALID_PASSWORD="$${TEST_CLIENT_INVALID_PASSWORD:-wrongpass}" \
-e TEST_CLIENT_COMPANY="$${TEST_CLIENT_COMPANY}" -e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" \
-e TEST_STAFF_OTP="$${TEST_STAFF_OTP}" -e TEST_STAFF_SIGNUP_PHONE="$${TEST_STAFF_SIGNUP_PHONE}"
-e TEST_STAFF_OTP="$${TEST_STAFF_OTP}" -e TEST_STAFF_INVALID_OTP="$${TEST_STAFF_INVALID_OTP:-000000}" -e TEST_STAFF_SIGNUP_PHONE="$${TEST_STAFF_SIGNUP_PHONE}"
test-e2e-client: test-e2e-setup
@echo "--> Running Client E2E (sign_in, sign_up)..."
@maestro test apps/mobile/apps/client/maestro/auth/sign_in.yaml apps/mobile/apps/client/maestro/auth/sign_up.yaml \
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml apps/mobile/apps/client/maestro/auth/sign_up.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}" \
-e TEST_CLIENT_COMPANY="$${TEST_CLIENT_COMPANY}"
test-e2e-staff: test-e2e-setup
@echo "--> Running Staff E2E (sign_in, sign_up)..."
@maestro test apps/mobile/apps/staff/maestro/auth/sign_in.yaml apps/mobile/apps/staff/maestro/auth/sign_up.yaml \
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml apps/mobile/apps/staff/maestro/auth/sign_up.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}" \
-e TEST_STAFF_SIGNUP_PHONE="$${TEST_STAFF_SIGNUP_PHONE}"
# Client E2E by folder (run folder-by-folder)
test-e2e-client-auth: test-e2e-setup
@echo "--> Running Client E2E auth flows (sign_in, sign_up, sign_in_invalid_password)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml apps/mobile/apps/client/maestro/auth/sign_up.yaml apps/mobile/apps/client/maestro/auth/sign_in_invalid_password.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}" -e TEST_CLIENT_INVALID_PASSWORD="$${TEST_CLIENT_INVALID_PASSWORD:-wrongpass}" \
-e TEST_CLIENT_COMPANY="$${TEST_CLIENT_COMPANY}"
test-e2e-client-navigation: test-e2e-setup
@echo "--> Running Client E2E navigation (sign_in first, then nav flows)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml \
apps/mobile/apps/client/maestro/navigation/home.yaml \
apps/mobile/apps/client/maestro/navigation/orders.yaml \
apps/mobile/apps/client/maestro/navigation/billing.yaml \
apps/mobile/apps/client/maestro/navigation/coverage.yaml \
apps/mobile/apps/client/maestro/navigation/reports.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}"
test-e2e-client-orders: test-e2e-setup
@echo "--> Running Client E2E orders (sign_in first, then order flows)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml \
apps/mobile/apps/client/maestro/orders/view_orders.yaml \
apps/mobile/apps/client/maestro/orders/completed_no_edit_icon.yaml \
apps/mobile/apps/client/maestro/orders/create_order_entry.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}"
test-e2e-client-settings: test-e2e-setup
@echo "--> Running Client E2E settings (sign_in first, then settings + edit_profile)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml \
apps/mobile/apps/client/maestro/settings/settings_page.yaml \
apps/mobile/apps/client/maestro/settings/edit_profile.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}"
test-e2e-client-sign-out: test-e2e-setup
@echo "--> Running Client E2E sign out..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml \
apps/mobile/apps/client/maestro/auth/sign_out.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}"
# Client extended (auth + navigation + orders + settings)
test-e2e-client-extended: test-e2e-setup
@echo "--> Running Client E2E extended suite..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml apps/mobile/apps/client/maestro/auth/sign_up.yaml \
apps/mobile/apps/client/maestro/navigation/home.yaml apps/mobile/apps/client/maestro/navigation/orders.yaml \
apps/mobile/apps/client/maestro/navigation/billing.yaml apps/mobile/apps/client/maestro/navigation/coverage.yaml \
apps/mobile/apps/client/maestro/navigation/reports.yaml apps/mobile/apps/client/maestro/orders/view_orders.yaml \
apps/mobile/apps/client/maestro/orders/completed_no_edit_icon.yaml apps/mobile/apps/client/maestro/orders/create_order_entry.yaml \
apps/mobile/apps/client/maestro/settings/settings_page.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}" \
-e TEST_CLIENT_COMPANY="$${TEST_CLIENT_COMPANY}"
# Staff E2E by folder (run folder-by-folder)
test-e2e-staff-auth: test-e2e-setup
@echo "--> Running Staff E2E auth flows (sign_in, sign_up, sign_in_invalid_otp)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml apps/mobile/apps/staff/maestro/auth/sign_up.yaml apps/mobile/apps/staff/maestro/auth/sign_in_invalid_otp.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}" -e TEST_STAFF_INVALID_OTP="$${TEST_STAFF_INVALID_OTP:-000000}" \
-e TEST_STAFF_SIGNUP_PHONE="$${TEST_STAFF_SIGNUP_PHONE}"
test-e2e-staff-navigation: test-e2e-setup
@echo "--> Running Staff E2E navigation (sign_in first, then navigation flows)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml \
apps/mobile/apps/staff/maestro/navigation/home.yaml \
apps/mobile/apps/staff/maestro/navigation/shifts.yaml \
apps/mobile/apps/staff/maestro/navigation/profile.yaml \
apps/mobile/apps/staff/maestro/navigation/payments.yaml \
apps/mobile/apps/staff/maestro/navigation/clock_in.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}"
test-e2e-staff-profile: test-e2e-setup
@echo "--> Running Staff E2E profile (sign_in first, then profile flows)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml \
apps/mobile/apps/staff/maestro/profile/personal_info.yaml \
apps/mobile/apps/staff/maestro/profile/documents_list.yaml \
apps/mobile/apps/staff/maestro/profile/certificates_list.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}"
test-e2e-staff-profile-extended: test-e2e-setup
@echo "--> Running Staff E2E profile extended (personal_info, documents, certificates, timecard, bank_account, faqs, privacy, emergency_contact)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml \
apps/mobile/apps/staff/maestro/profile/personal_info.yaml \
apps/mobile/apps/staff/maestro/profile/documents_list.yaml \
apps/mobile/apps/staff/maestro/profile/certificates_list.yaml \
apps/mobile/apps/staff/maestro/profile/time_card.yaml \
apps/mobile/apps/staff/maestro/profile/bank_account.yaml \
apps/mobile/apps/staff/maestro/profile/faqs.yaml \
apps/mobile/apps/staff/maestro/profile/privacy_security.yaml \
apps/mobile/apps/staff/maestro/profile/emergency_contact.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}"
test-e2e-staff-sign-out: test-e2e-setup
@echo "--> Running Staff E2E sign out..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml \
apps/mobile/apps/staff/maestro/auth/sign_out.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}"
test-e2e-staff-shifts: test-e2e-setup
@echo "--> Running Staff E2E shifts (sign_in first, then shifts flows)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml \
apps/mobile/apps/staff/maestro/shifts/find_shifts.yaml \
apps/mobile/apps/staff/maestro/shifts/incomplete_profile_banner.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}"
test-e2e-staff-compliance: test-e2e-setup
@echo "--> Running Staff E2E compliance (sign_in first, then compliance flows)..."
@maestro test $(MAESTRO_SHARDS) \
apps/mobile/apps/staff/maestro/auth/sign_in.yaml \
apps/mobile/apps/staff/maestro/compliance/document_upload_banner.yaml \
apps/mobile/apps/staff/maestro/compliance/certificate_upload_banner.yaml \
apps/mobile/apps/staff/maestro/compliance/attire_upload_banner.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}"
test-e2e-staff-home: test-e2e-setup
@echo "--> Running Staff E2E home (sign_in first, then home flows)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml \
apps/mobile/apps/staff/maestro/home/benefits.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}"
# Staff extended (auth + navigation + profile + compliance + shifts + benefits)
test-e2e-staff-extended: test-e2e-setup
@echo "--> Running Staff E2E extended suite..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/staff/maestro/auth/sign_in.yaml apps/mobile/apps/staff/maestro/auth/sign_up.yaml \
apps/mobile/apps/staff/maestro/navigation/home.yaml apps/mobile/apps/staff/maestro/navigation/shifts.yaml \
apps/mobile/apps/staff/maestro/navigation/profile.yaml apps/mobile/apps/staff/maestro/navigation/payments.yaml \
apps/mobile/apps/staff/maestro/navigation/clock_in.yaml apps/mobile/apps/staff/maestro/profile/personal_info.yaml \
apps/mobile/apps/staff/maestro/profile/documents_list.yaml apps/mobile/apps/staff/maestro/profile/certificates_list.yaml \
apps/mobile/apps/staff/maestro/shifts/find_shifts.yaml apps/mobile/apps/staff/maestro/compliance/document_upload_banner.yaml \
apps/mobile/apps/staff/maestro/compliance/certificate_upload_banner.yaml apps/mobile/apps/staff/maestro/compliance/attire_upload_banner.yaml \
apps/mobile/apps/staff/maestro/shifts/incomplete_profile_banner.yaml apps/mobile/apps/staff/maestro/home/benefits.yaml \
-e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" -e TEST_STAFF_OTP="$${TEST_STAFF_OTP}" \
-e TEST_STAFF_SIGNUP_PHONE="$${TEST_STAFF_SIGNUP_PHONE}"
# Extended E2E: auth + navigation + compliance + feature flows (both apps)
test-e2e-extended: test-e2e-setup
@echo "--> Running extended E2E suite (auth, navigation, compliance, feature flows)..."
@maestro test $(MAESTRO_SHARDS) apps/mobile/apps/client/maestro/auth/sign_in.yaml apps/mobile/apps/client/maestro/auth/sign_up.yaml \
apps/mobile/apps/client/maestro/navigation/home.yaml apps/mobile/apps/client/maestro/navigation/orders.yaml \
apps/mobile/apps/client/maestro/navigation/billing.yaml apps/mobile/apps/client/maestro/navigation/coverage.yaml \
apps/mobile/apps/client/maestro/navigation/reports.yaml apps/mobile/apps/client/maestro/orders/view_orders.yaml \
apps/mobile/apps/client/maestro/orders/completed_no_edit_icon.yaml apps/mobile/apps/client/maestro/orders/create_order_entry.yaml \
apps/mobile/apps/client/maestro/settings/settings_page.yaml \
apps/mobile/apps/staff/maestro/auth/sign_in.yaml apps/mobile/apps/staff/maestro/auth/sign_up.yaml \
apps/mobile/apps/staff/maestro/navigation/home.yaml apps/mobile/apps/staff/maestro/navigation/shifts.yaml \
apps/mobile/apps/staff/maestro/navigation/profile.yaml apps/mobile/apps/staff/maestro/navigation/payments.yaml \
apps/mobile/apps/staff/maestro/navigation/clock_in.yaml apps/mobile/apps/staff/maestro/profile/personal_info.yaml \
apps/mobile/apps/staff/maestro/profile/documents_list.yaml apps/mobile/apps/staff/maestro/profile/certificates_list.yaml \
apps/mobile/apps/staff/maestro/shifts/find_shifts.yaml apps/mobile/apps/staff/maestro/compliance/document_upload_banner.yaml \
apps/mobile/apps/staff/maestro/compliance/certificate_upload_banner.yaml apps/mobile/apps/staff/maestro/compliance/attire_upload_banner.yaml \
apps/mobile/apps/staff/maestro/shifts/incomplete_profile_banner.yaml apps/mobile/apps/staff/maestro/home/benefits.yaml \
-e TEST_CLIENT_EMAIL="$${TEST_CLIENT_EMAIL}" -e TEST_CLIENT_PASSWORD="$${TEST_CLIENT_PASSWORD}" \
-e TEST_CLIENT_COMPANY="$${TEST_CLIENT_COMPANY}" -e TEST_STAFF_PHONE="$${TEST_STAFF_PHONE}" \
-e TEST_STAFF_OTP="$${TEST_STAFF_OTP}" -e TEST_STAFF_SIGNUP_PHONE="$${TEST_STAFF_SIGNUP_PHONE}"