# ts-customer-02-05 — §2 anonymous path, first-timer (USP not yet seen) →
# PickMethod (method-pick screen).
# Spec ref: requirement/flow_customer.mermaid.md §2, branch
#   VerifChoice="tanpa verif · Rp5k+" → USPGateB="no · first-timer" →
#   USPb → PickMethod.
#
# Anonymous path skips OTP entirely — no router redirect needed (user
# stays AuthAnonymousData). USP screen pushes /payment/method-pick
# directly when verified=false. Verifies onboardingIntent is NOT set
# (it stays `recover` because we picked "curhat anonim", not "verifikasi").
appId: com.mybestie
env:
  TEST_PHONE: "+6281234567890"
  BACKEND_INTERNAL_URL: http://localhost:3001
---
- runScript:
    file: ../scripts/reset_phone.js
    env:
      TEST_PHONE: ${TEST_PHONE}
      BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL}
- launchApp:
    clearState: true

# Welcome → SHome1st.
- extendedWaitUntil:
    visible:
      text: "Mulai"
    timeout: 15000
- tapOn:
    text: "Mulai"
    retryTapIfNoChange: true

# "aku mau curhat" → S2 Nama.
- extendedWaitUntil:
    visible:
      text: "(?s).*aku mau curhat.*"
    timeout: 30000
- tapOn: "(?s).*aku mau curhat.*"

# S2 Nama — submit display name.
- extendedWaitUntil:
    visible:
      text: "(?s).*Siapa namamu.*"
    timeout: 10000
- tapOn:
    point: "50%, 28%"
- inputText: "MaestroAnon"
- tapOn: "lanjut"

# VerifChoiceSheet — pick "curhat anonim" (anonymous branch). Per
# routeForVerifChoice (verif_choice_sheet.dart L94), USP-not-seen takes
# /onboarding/anon/usp; USP-seen would go directly to /payment/method-pick.
- extendedWaitUntil:
    visible:
      text: "(?s).*Mau curhat sebagai siapa.*"
    timeout: 10000
- tapOn: "(?s).*curhat anonim.*"

# USPb (anonymous variant) — first-timer.
- extendedWaitUntil:
    visible:
      text: "Sebelum mulai"
    timeout: 10000
- tapOn: "(?s).*aku ngerti.*"

# Assert: /payment/method-pick visible (PickMethod in spec).
- extendedWaitUntil:
    visible:
      text: "(?s).*pilih cara curhat.*"
    timeout: 15000
- assertVisible: "(?s).*tulis dan baca dengan tenang.*"
