chore: Maestro restructure, remove Marionette, add Makefile e2e commands

This commit is contained in:
2026-02-26 16:07:43 +05:30
parent c69949abf4
commit fd43494bd4
25 changed files with 289 additions and 314 deletions

View File

@@ -1,75 +1,92 @@
# How to Run Maestro Integration Tests
## Credentials
Credentials are injected via env variables — **never hardcoded** in YAML.
| Flow | Credentials |
|------|-------------|
| **Client login** | legendary@krowd.com / Demo2026! |
| **Staff login** | 5557654321 / OTP 123456 |
| **Client signup** | Env vars: `MAESTRO_CLIENT_EMAIL`, `MAESTRO_CLIENT_PASSWORD`, `MAESTRO_CLIENT_COMPANY` |
| **Staff signup** | Env var: `MAESTRO_STAFF_SIGNUP_PHONE` (must be new Firebase test phone) |
## Env variables
| Flow | Env variables |
|------|---------------|
| **Client sign-in** | `TEST_CLIENT_EMAIL`, `TEST_CLIENT_PASSWORD` |
| **Client sign-up** | `TEST_CLIENT_EMAIL`, `TEST_CLIENT_PASSWORD`, `TEST_CLIENT_COMPANY` |
| **Staff sign-in** | `TEST_STAFF_PHONE`, `TEST_STAFF_OTP` |
| **Staff sign-up** | `TEST_STAFF_SIGNUP_PHONE`, `TEST_STAFF_OTP` |
**Example values (login):** legendary@krowd.com / Demo2026! (client), 5557654321 / 123456 (staff)
---
## Step-by-step: Run login tests
## Step-by-step
### 1. Install Maestro CLI
**Windows:** Download from [Maestro releases](https://github.com/mobile-dev-inc/maestro/releases), extract, add to PATH.
**macOS/Linux:**
```bash
curl -Ls "https://get.maestro.mobile.dev" | bash
```
Or: https://maestro.dev/docs/getting-started/installation
### 2. Add Firebase test phone (Staff app)
### 2. Add Firebase test phone (Staff app only)
Firebase Console → **Authentication****Sign-in method****Phone****Phone numbers for testing**:
- Add **+1 5557654321** with verification code **123456**
In [Firebase Console](https://console.firebase.google.com) → your project → **Authentication****Sign-in method****Phone****Phone numbers for testing**:
- Add: **+1 5557654321** with verification code **123456**
### 3. Build and install the apps
From the **project root**:
### 3. Build and install apps
```bash
# Client
make mobile-client-build PLATFORM=apk MODE=debug
adb install apps/mobile/apps/client/build/app/outputs/flutter-apk/app-debug.apk
# Staff
make mobile-staff-build PLATFORM=apk MODE=debug
adb install apps/mobile/apps/staff/build/app/outputs/flutter-apk/app-debug.apk
```
Or run the app on a connected device/emulator: `make mobile-client-dev-android DEVICE=<id>` (then Maestro can launch the already-installed app by appId).
### 4. Run E2E tests via Makefile
### 4. Run Maestro tests
From the **project root** (`e:\Krow-google\krow-workforce`):
**Export credentials, then run:**
```bash
# Client login (uses legendary@krowd.com / Demo2026!)
maestro test apps/mobile/apps/client/maestro/login.yaml
# Client login credentials
export TEST_CLIENT_EMAIL=legendary@krowd.com
export TEST_CLIENT_PASSWORD=Demo2026!
export TEST_CLIENT_COMPANY="Krow Demo"
# Staff login (uses 5557654321 / OTP 123456)
maestro test apps/mobile/apps/staff/maestro/login.yaml
# Staff login credentials
export TEST_STAFF_PHONE=5557654321
export TEST_STAFF_OTP=123456
export TEST_STAFF_SIGNUP_PHONE=5555550000 # use a new number for signup
# Run full suite
make test-e2e
# Or run per app
make test-e2e-client
make test-e2e-staff
```
### 5. Run signup tests (optional)
### 5. Run flows directly (without Make)
**Client signup** — set env vars first:
```bash
$env:MAESTRO_CLIENT_EMAIL="newuser@example.com"
$env:MAESTRO_CLIENT_PASSWORD="YourPassword123!"
$env:MAESTRO_CLIENT_COMPANY="Test Company"
maestro test apps/mobile/apps/client/maestro/signup.yaml
maestro test apps/mobile/apps/client/maestro/auth/sign_in.yaml \
-e TEST_CLIENT_EMAIL=legendary@krowd.com \
-e TEST_CLIENT_PASSWORD=Demo2026!
maestro test apps/mobile/apps/staff/maestro/auth/sign_in.yaml \
-e TEST_STAFF_PHONE=5557654321 \
-e TEST_STAFF_OTP=123456
```
**Staff signup** — use a new Firebase test phone:
```bash
# Add +1 555-555-0000 / 123456 in Firebase, then:
$env:MAESTRO_STAFF_SIGNUP_PHONE="5555550000"
maestro test apps/mobile/apps/staff/maestro/signup.yaml
---
## Folder structure
```
apps/mobile/apps/client/maestro/auth/
sign_in.yaml
sign_up.yaml
apps/mobile/apps/staff/maestro/auth/
sign_in.yaml
sign_up.yaml
```
---
@@ -77,8 +94,7 @@ maestro test apps/mobile/apps/staff/maestro/signup.yaml
## Checklist
- [ ] Maestro CLI installed
- [ ] Firebase test phone +1 5557654321 / 123456 added (for staff)
- [ ] Client app built and installed
- [ ] Staff app built and installed
- [ ] Run from project root: `maestro test apps/mobile/apps/client/maestro/login.yaml`
- [ ] Run from project root: `maestro test apps/mobile/apps/staff/maestro/login.yaml`
- [ ] Firebase test phone +1 5557654321 / 123456 added
- [ ] Client & Staff apps built and installed
- [ ] Env vars exported
- [ ] `make test-e2e` run from project root