Files
halobestie-clone/client_app/.maestro/subflows/onboarding_new_user_verified.yaml
Ramadhan Sjamsani 093256ff7d Phase 4 §2 + §1/§4: OnboardingIntent post-OTP routing + test naming + register-screen overflow
Spec §2 (flow_customer.mermaid) routes post-OTP based on user-lookup +
has_transacted, but the implementation previously dumped every OTP
success on /home. Introduce `OnboardingIntent` provider: set to
`onboarding` by routeForVerifChoice's verified branch (the "aku mau
curhat" transaction journey), set to `recover` by SHome1st's masuk →
banner. Router redirect on AuthAuthenticatedData+isAuthRoute consumes it:
`onboarding` → /payment/entry (dispatches S6 paywall vs PickMethod via
first_session_discount.eligible); `recover` → /home. Intent is reset in
/payment/entry's initState so subsequent masuk → flows don't inherit it.

auth_notifier.verifyOtp uses .copyWithPrevious on AsyncError so
valueOrNull retains AuthOtpSentData/AuthAnonymousData through OTP
failures — required for the OTP-blocked recovery path
(/onboarding/anon/method → /payment/method-pick) to clear the global
redirect without bouncing to /home. Router also extends the
isAuthRoute/isOnboardingFlow carve-out to AuthOtpSentData.

Maestro tests adopt `ts-<app>-<NN>-<MM>-<descriptor>.yaml` convention:
NN = mermaid section, MM = sub-flow index. New ts-customer-02-01..05
cover the §2 branches (verified brand-new → S6, existing-no-tx → S6,
existing-tx → method-pick, OTP-blocked → method-pick, anonymous first-
timer → method-pick); deferred 02-06/07/08/09 documented in
README_section_02.md. TS-07 → ts-customer-02-10 (masuk → recovery);
TS-01..06 → ts-customer-04-01..06 (§4 returning-user). Shared
onboarding_new_user_verified.yaml subflow extracted.

Register screen's body Column now uses LayoutBuilder + SingleChildScrollView
+ ConstrainedBox + IntrinsicHeight so the keyboard-open layout no
longer overflows by 1.3 px (verified visually).

Spec prose updated at flow_customer.mermaid §2 to describe the
intent-driven routing + login-vs-transaction divergence.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 21:50:04 +08:00

89 lines
2.8 KiB
YAML

# Shared §2 verified onboarding prelude — covers cold-start → SHome1st →
# "aku mau curhat" → S2 Nama → VerifChoiceSheet "verifikasi nomor HP" →
# S5b USP (if first-timer) → S3a Phone → S3b OTP → verifyOtp.
#
# After this subflow returns, the post-OTP redirect has fired:
# - intent=onboarding (set in routeForVerifChoice verified branch) →
# /payment/entry → /payment/discount-paywall (S6) for eligible users,
# OR /payment/method-pick for has_transacted=true users.
# Callers assert which destination is visible.
#
# Pre-reqs (parent flow's responsibility):
# - `env:` with TEST_PHONE and BACKEND_INTERNAL_URL.
# - reset_phone.js + launchApp clearState: true BEFORE this subflow.
# - ≥1 mitra online so the "aku mau curhat" CTA is enabled.
#
# Selector style: same regex-merged-node rules as
# onboarding_returning_user.yaml apply (see feedback-maestro-wsl-setup).
appId: ${APP_ID_ANDROID}
---
# Welcome carousel auto-advances 0→1→2 (1s each). Wait for Mulai on slide 3.
- extendedWaitUntil:
visible:
text: "Mulai"
timeout: 15000
- tapOn:
text: "Mulai"
retryTapIfNoChange: true
# SHome1st "aku mau curhat" CTA → /auth/display-name.
- extendedWaitUntil:
visible:
text: "(?s).*aku mau curhat.*"
timeout: 30000
- tapOn: "(?s).*aku mau curhat.*"
# S2 Nama — type name + Lanjut. No hideKeyboard (TextField.onSubmitted
# would auto-fire _submit and tear down the screen before Lanjut tap
# resolves). The "Nama panggilan" hint isn't visible in a11y; point-tap
# the field area (28% of viewport y on tested Pixel profile).
- extendedWaitUntil:
visible:
text: "(?s).*Siapa namamu.*"
timeout: 10000
- tapOn:
point: "50%, 28%"
- inputText: "MaestroNew"
- tapOn: "lanjut"
# VerifChoiceSheet — verified branch sets onboardingIntentProvider =
# onboarding (verif_choice_sheet.dart L87) so the router can route to
# /payment/entry post-OTP.
- extendedWaitUntil:
visible:
text: "(?s).*Mau curhat sebagai siapa.*"
timeout: 10000
- tapOn: "(?s).*verifikasi nomor HP.*"
# S5b USP — first-timer only (usp_seen=false after clearState). If
# parent flow pre-marked USP as seen, this step is skipped because the
# verified branch goes straight to /auth/register.
- runFlow:
when:
visible:
text: "Sebelum mulai"
commands:
- tapOn: "(?s).*aku ngerti.*"
# S3a phone input → kirim kode.
- extendedWaitUntil:
visible:
text: "(?s).*nomor wa-mu.*"
timeout: 10000
- tapOn:
point: "60%, 47%"
- inputText: "81234567890"
- tapOn: "(?s).*kirim kode.*"
# S3b OTP — peek stub, auto-submits on 6th digit.
- extendedWaitUntil:
visible:
text: "Masukkan OTP"
timeout: 15000
- runScript:
file: ../scripts/peek_otp.js
env:
TEST_PHONE: ${TEST_PHONE}
BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL}
- inputText: ${output.OTP}