chore: Maestro restructure, remove Marionette, add Makefile e2e commands
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:client_authentication/client_authentication.dart'
|
||||
as client_authentication;
|
||||
import 'package:client_create_order/client_create_order.dart'
|
||||
@@ -12,7 +10,6 @@ import 'package:design_system/design_system.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marionette_flutter/marionette_flutter.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
@@ -23,23 +20,7 @@ import 'firebase_options.dart';
|
||||
import 'src/widgets/session_listener.dart';
|
||||
|
||||
void main() async {
|
||||
final bool isFlutterTest =
|
||||
!kIsWeb ? Platform.environment.containsKey('FLUTTER_TEST') : false;
|
||||
if (kDebugMode && !isFlutterTest) {
|
||||
MarionetteBinding.ensureInitialized(
|
||||
MarionetteConfiguration(
|
||||
isInteractiveWidget: (Type type) =>
|
||||
type == UiButton || type == UiTextField,
|
||||
extractText: (Widget widget) {
|
||||
if (widget is UiTextField) return widget.label;
|
||||
if (widget is UiButton) return widget.text;
|
||||
return null;
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
}
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await Firebase.initializeApp(
|
||||
options: kIsWeb ? DefaultFirebaseOptions.currentPlatform : null,
|
||||
);
|
||||
|
||||
@@ -1,42 +1,33 @@
|
||||
# Maestro Integration Tests — Client App
|
||||
|
||||
Login and signup flows for the KROW Client app.
|
||||
See [docs/research/flutter-testing-tools.md](/docs/research/flutter-testing-tools.md) for the evaluation report.
|
||||
**Full run instructions:** [docs/research/maestro-test-run-instructions.md](/docs/research/maestro-test-run-instructions.md)
|
||||
Auth flows for the KROW Client app.
|
||||
See [docs/research/flutter-testing-tools.md](/docs/research/flutter-testing-tools.md) and [maestro-test-run-instructions.md](/docs/research/maestro-test-run-instructions.md).
|
||||
|
||||
## Prerequisites
|
||||
## Structure
|
||||
|
||||
- [Maestro CLI](https://maestro.dev/docs/getting-started/installation) installed
|
||||
- Client app built and installed on device/emulator:
|
||||
```bash
|
||||
cd apps/mobile && flutter build apk
|
||||
adb install build/app/outputs/flutter-apk/app-debug.apk
|
||||
```
|
||||
```
|
||||
maestro/
|
||||
auth/
|
||||
sign_in.yaml
|
||||
sign_up.yaml
|
||||
```
|
||||
|
||||
## Credentials
|
||||
## Credentials (env, never hardcoded)
|
||||
|
||||
| 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) |
|
||||
| Flow | Env variables |
|
||||
|------|---------------|
|
||||
| sign_in | `TEST_CLIENT_EMAIL`, `TEST_CLIENT_PASSWORD` |
|
||||
| sign_up | `TEST_CLIENT_EMAIL`, `TEST_CLIENT_PASSWORD`, `TEST_CLIENT_COMPANY` |
|
||||
|
||||
## Run
|
||||
|
||||
From the project root:
|
||||
|
||||
```bash
|
||||
# Login
|
||||
maestro test apps/mobile/apps/client/maestro/login.yaml
|
||||
# Via Makefile (export vars first)
|
||||
make test-e2e-client
|
||||
|
||||
# Signup
|
||||
maestro test apps/mobile/apps/client/maestro/signup.yaml
|
||||
# Direct
|
||||
maestro test apps/mobile/apps/client/maestro/auth/sign_in.yaml \
|
||||
-e TEST_CLIENT_EMAIL=... -e TEST_CLIENT_PASSWORD=...
|
||||
maestro test apps/mobile/apps/client/maestro/auth/sign_up.yaml \
|
||||
-e TEST_CLIENT_EMAIL=... -e TEST_CLIENT_PASSWORD=... -e TEST_CLIENT_COMPANY=...
|
||||
```
|
||||
|
||||
## Flows
|
||||
|
||||
| File | Flow | Description |
|
||||
|------------|-------------|--------------------------------------------|
|
||||
| login.yaml | Client Login| Get Started → Sign In → Home |
|
||||
| signup.yaml| Client Signup| Get Started → Create Account → Home |
|
||||
|
||||
22
apps/mobile/apps/client/maestro/auth/sign_in.yaml
Normal file
22
apps/mobile/apps/client/maestro/auth/sign_in.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
# Client App — Sign In flow
|
||||
# Credentials via env: TEST_CLIENT_EMAIL, TEST_CLIENT_PASSWORD
|
||||
# Run: maestro test apps/mobile/apps/client/maestro/auth/sign_in.yaml -e TEST_CLIENT_EMAIL=... -e TEST_CLIENT_PASSWORD=...
|
||||
# Or: export MAESTRO_TEST_CLIENT_EMAIL / MAESTRO_TEST_CLIENT_PASSWORD (Maestro auto-reads MAESTRO_*)
|
||||
|
||||
appId: com.krowwithus.client
|
||||
env:
|
||||
EMAIL: ${TEST_CLIENT_EMAIL}
|
||||
PASSWORD: ${TEST_CLIENT_PASSWORD}
|
||||
---
|
||||
- launchApp
|
||||
- assertVisible: "Sign In"
|
||||
- tapOn: "Sign In"
|
||||
- assertVisible: "Email"
|
||||
- tapOn:
|
||||
id: sign_in_email
|
||||
- inputText: ${EMAIL}
|
||||
- tapOn:
|
||||
id: sign_in_password
|
||||
- inputText: ${PASSWORD}
|
||||
- tapOn: "Sign In"
|
||||
- assertVisible: "Home"
|
||||
28
apps/mobile/apps/client/maestro/auth/sign_up.yaml
Normal file
28
apps/mobile/apps/client/maestro/auth/sign_up.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
# Client App — Sign Up flow
|
||||
# Credentials via env: TEST_CLIENT_EMAIL, TEST_CLIENT_PASSWORD, TEST_CLIENT_COMPANY
|
||||
# Run: maestro test apps/mobile/apps/client/maestro/auth/sign_up.yaml -e TEST_CLIENT_EMAIL=... -e TEST_CLIENT_PASSWORD=... -e TEST_CLIENT_COMPANY=...
|
||||
|
||||
appId: com.krowwithus.client
|
||||
env:
|
||||
EMAIL: ${TEST_CLIENT_EMAIL}
|
||||
PASSWORD: ${TEST_CLIENT_PASSWORD}
|
||||
COMPANY: ${TEST_CLIENT_COMPANY}
|
||||
---
|
||||
- launchApp
|
||||
- assertVisible: "Create Account"
|
||||
- tapOn: "Create Account"
|
||||
- assertVisible: "Company"
|
||||
- tapOn:
|
||||
id: sign_up_company
|
||||
- inputText: ${COMPANY}
|
||||
- tapOn:
|
||||
id: sign_up_email
|
||||
- inputText: ${EMAIL}
|
||||
- tapOn:
|
||||
id: sign_up_password
|
||||
- inputText: ${PASSWORD}
|
||||
- tapOn:
|
||||
id: sign_up_confirm_password
|
||||
- inputText: ${PASSWORD}
|
||||
- tapOn: "Create Account"
|
||||
- assertVisible: "Home"
|
||||
@@ -1,18 +0,0 @@
|
||||
# Client App - Login Flow
|
||||
# Prerequisites: App built and installed (debug or release)
|
||||
# Run: maestro test apps/mobile/apps/client/maestro/login.yaml
|
||||
# Test credentials: legendary@krowd.com / Demo2026!
|
||||
# Note: Auth uses Firebase/Data Connect
|
||||
|
||||
appId: com.krowwithus.client
|
||||
---
|
||||
- launchApp
|
||||
- assertVisible: "Sign In"
|
||||
- tapOn: "Sign In"
|
||||
- assertVisible: "Email"
|
||||
- tapOn: "Email"
|
||||
- inputText: "legendary@krowd.com"
|
||||
- tapOn: "Password"
|
||||
- inputText: "Demo2026!"
|
||||
- tapOn: "Sign In"
|
||||
- assertVisible: "Home"
|
||||
@@ -1,23 +0,0 @@
|
||||
# Client App - Sign Up Flow
|
||||
# Prerequisites: App built and installed
|
||||
# Run: maestro test apps/mobile/apps/client/maestro/signup.yaml
|
||||
# Use NEW credentials for signup (creates new account)
|
||||
# Env: MAESTRO_CLIENT_EMAIL, MAESTRO_CLIENT_PASSWORD, MAESTRO_CLIENT_COMPANY
|
||||
|
||||
appId: com.krowwithus.client
|
||||
---
|
||||
- launchApp
|
||||
- assertVisible: "Create Account"
|
||||
- tapOn: "Create Account"
|
||||
- assertVisible: "Company"
|
||||
- tapOn: "Company"
|
||||
- inputText: "${MAESTRO_CLIENT_COMPANY}"
|
||||
- tapOn: "Email"
|
||||
- inputText: "${MAESTRO_CLIENT_EMAIL}"
|
||||
- tapOn: "Password"
|
||||
- inputText: "${MAESTRO_CLIENT_PASSWORD}"
|
||||
- tapOn:
|
||||
text: "Confirm Password"
|
||||
- inputText: "${MAESTRO_CLIENT_PASSWORD}"
|
||||
- tapOn: "Create Account"
|
||||
- assertVisible: "Home"
|
||||
@@ -42,7 +42,6 @@ dependencies:
|
||||
sdk: flutter
|
||||
firebase_core: ^4.4.0
|
||||
krow_data_connect: ^0.0.1
|
||||
marionette_flutter: ^0.3.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user