# ts-mitra-A-03 — §A.2 happy path → /home # Spec ref: requirement/flow_mitra.mermaid.md §A.2 (200 + is_active=true branch). # # End-to-end S3a → S3b → home for an active mitra: # 1. Seed mitra row with is_active=true # 2. Reset OTP requests (so cooldown/rate-limit doesn't trip) # 3. Drive S3a, request OTP # 4. Peek the stub OTP code from the backend # 5. Submit it on S3b → /home renders appId: com.mybestie.mitra env: TEST_PHONE: "+628200000301" MITRA_DISPLAY_NAME: "Maestro Active" BACKEND_INTERNAL_URL: http://localhost:3001 --- - runScript: file: ../scripts/seed_mitra.js env: TEST_PHONE: ${TEST_PHONE} MITRA_DISPLAY_NAME: ${MITRA_DISPLAY_NAME} IS_ACTIVE: "true" BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL} - runScript: file: ../scripts/reset_phone.js env: TEST_PHONE: ${TEST_PHONE} BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL} - launchApp: clearState: true - extendedWaitUntil: visible: text: "(?s).*Halo Mitra Bestie.*" timeout: 10000 # S3a — request OTP. - tapOn: point: "60%, 47%" - inputText: "8200000301" - tapOn: "(?s).*kirim kode.*" - extendedWaitUntil: visible: text: "(?s).*masukin 6 digit kode.*" timeout: 10000 # Peek the stub OTP that the backend just generated. Stored in output.OTP. - runScript: file: ../scripts/peek_otp.js env: TEST_PHONE: ${TEST_PHONE} BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL} # Submit it. inputText delivers the chars one-at-a-time via adb shell input; # the Focus(canRequestFocus:false)-wrapped TextFields chain focus on each # digit and _submit() fires automatically when the 6th digit lands. - inputText: ${output.OTP} # Assert: home renders. Use any text we know lives on the home/active-sessions # tab to confirm we're past auth. - extendedWaitUntil: visible: text: "Sesi Aktif|Riwayat Chat" timeout: 15000