Phase 5/6 polish: end-session flow, notif sound on API 33+, Xendit webview
Customer end-of-session (figma §6):
- PricingBottomSheet: ghost "cukup, akhiri sesi" CTA + dedup divider
- chat_screen._runEndSessionFlow chains ConfirmEndStep1 → ConfirmEndStep2
→ ClosingMessageSheet (or "lewati saja" → close + /home). The four
popup/sheet widgets already existed; this commit just wires them
- showModalBottomSheet: showDragHandle=false to suppress the Material 3
auto-injected handle that was stacking with our own pill
Notification sound on API 33+:
- Bump channel halobestie_chat_v1 → halobestie_chat_v2, created from
native Kotlin in MainActivity.kt with AudioAttributes contentType
CONTENT_TYPE_SONIFICATION. flutter_local_notifications' default of
CONTENT_TYPE_UNKNOWN was causing Android 13 to silently drop audio
focus while the notification still posted (isNoisy=true). Both apps
- Backend FCM payload channelId updated to v2
- AndroidManifest meta-data: default_notification_icon + color → brand
silhouette tinted pink instead of generic Android bell. Both apps
Customer pairing reliability:
- pairing_notifier: applyPairedFromPush({sessionId, mitraName}) unsticks
searching screen when WS push failed and FCM/active-session-poll is
the first signal. Idempotent across PairingSearchingData,
PairingTargetedWaitingData, PairingErrorData (covers ALREADY_ACTIVE)
- notification_service: dispatches every FCM data payload to an
onDataMessage callback (foreground + tap + cold-start). main.dart
wires that to applyPairedFromPush on type=='paired'. Foreground
'paired' no longer renders a local banner — screen self-advances
- main.dart activeSession listener also calls applyPairedFromPush when
a session appears server-side while pairing is in a waiting state.
Covers stale ALREADY_ACTIVE recovery without a full page refresh
Auth refresh token race:
- auth_notifier._refreshFromStorage shares a single in-flight Future
across all callers (Auth.build + 401-retry path). Backend rotates
refresh tokens, so concurrent callers using the same stored token
would race → loser 401s → catch wipes flutter_secure_storage → user
appears logged out after kill+reopen
Polish:
- method_pick_screen: resizeToAvoidBottomInset=false — prevents the
one-frame overflow when entering with the previous screen's keyboard
still animating out
- bestie_history: BestieHistoryItem now carries `status` (backend
already returns it). Removed _rawHistoryProvider that fetched the
same endpoint just to read status; the two providers could go out
of sync mid-rebuild and throw RangeError(length) on indexing
Xendit Stage 8 (carried from WIP):
- xendit_checkout_screen: embedded webview hosting Xendit's invoice
page (intercepts halobestie:// deeplink + return-page URLs for
deterministic pop)
- waiting_payment_screen: auto-pushes the webview when the backend
payload includes xendit_invoice_url; spinner card + "Buka ulang
halaman pembayaran" CTA for the QR-fallback path
- pubspec: webview_flutter ^4.13.0
Maestro infra:
- subflows/onboarding_returning_user: drop the "Mulai" carousel wait
(splash auto-advances since 2026-05-26); tap phone-field hint
instead of point; drop hideKeyboard (sends BACK → /home when the
IME isn't actually up)
- New flow ts-customer-06-01-end_session_via_timeup_sheet: drives
the full path to the chat-expired banner. Last step blocked by a
Maestro+Flutter gesture quirk on the perpanjang ElevatedButton
(raw `adb input tap` works at the same coords). Documented in
memory; deeplink fixture or manual verify recommended
- ChatExpiredBanner button wrapped with Semantics(identifier:
'chat_extend_button', button: true, onTap: …) — good hygiene for
future tests even though it doesn't fix the dadb tap issue
.dev/: tracked wsl_emulator_bridge.ps1 + wsl_tcp_relay.py for
Maestro-on-WSL setup (Windows-side netsh portproxy + WSL-side
loopback relays). Both referenced from existing CLAUDE.md notes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,190 @@
|
||||
# ts-customer-06-01 — End-of-session via the Time-up Sheet's "cukup,
|
||||
# akhiri sesi" ghost CTA → ConfirmEndStep1 → ConfirmEndStep2 → Closing
|
||||
# Message Sheet → /home.
|
||||
#
|
||||
# Spec ref: requirement/flow_customer.mermaid.md §6 (End-of-session
|
||||
# sequence) + flow_customer.md "5.8.2.1.x".
|
||||
#
|
||||
# Feature under test:
|
||||
# - PricingBottomSheet now exposes 2 CTAs: primary "perpanjang Rp..."
|
||||
# (or "pilih durasi dulu" with no tier picked) AND a ghost
|
||||
# "cukup, akhiri sesi" that opens the 2-step confirm chain. The
|
||||
# four widgets — PricingBottomSheet, ConfirmEndStep1, ConfirmEndStep2,
|
||||
# ClosingMessageSheet — already existed but weren't wired together
|
||||
# before today's change in chat_screen.dart::_runEndSessionFlow.
|
||||
#
|
||||
# Path traced here: Time-up sheet → "cukup, akhiri sesi" → ConfirmEndStep1
|
||||
# "lanjut akhiri" → ConfirmEndStep2 "tulis pesan penutup" → ClosingMessageSheet
|
||||
# "kirim & akhiri sesi" → /home.
|
||||
#
|
||||
# Pre-reqs:
|
||||
# - Backend reachable at BACKEND_INTERNAL_URL with NODE_ENV != 'production'
|
||||
# (needs the /internal/_test/* harness endpoints).
|
||||
# - ≥1 mitra online to accept the blast.
|
||||
appId: com.mybestie
|
||||
env:
|
||||
TEST_PHONE: "+6281234567890"
|
||||
BACKEND_INTERNAL_URL: http://localhost:3001
|
||||
---
|
||||
# ── Setup: auth + seed history + pair into an active chat ───────────────
|
||||
- runScript:
|
||||
file: ../scripts/reset_phone.js
|
||||
env:
|
||||
TEST_PHONE: ${TEST_PHONE}
|
||||
BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL}
|
||||
- launchApp:
|
||||
clearState: true
|
||||
- runFlow: ../subflows/onboarding_returning_user.yaml
|
||||
|
||||
- runScript:
|
||||
file: ../scripts/seed_history_session.js
|
||||
env:
|
||||
TEST_PHONE: ${TEST_PHONE}
|
||||
BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL}
|
||||
- swipe:
|
||||
start: "50%, 30%"
|
||||
end: "50%, 80%"
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "(?s).*curhatan sebelumnya.*"
|
||||
timeout: 10000
|
||||
|
||||
# Curhat sama bestie baru → choice sheet → bestie baru → method-pick
|
||||
- tapOn:
|
||||
text: "(?s).*curhat sama bestie baru.*"
|
||||
retryTapIfNoChange: true
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "(?s).*mau curhat sama siapa.*"
|
||||
timeout: 5000
|
||||
- tapOn: "(?s).*cari bestie baru yang siap dengerin.*"
|
||||
|
||||
# Payment chain → confirm → pairing accepted → on chat screen
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "(?s).*pilih cara curhat.*"
|
||||
timeout: 10000
|
||||
- tapOn:
|
||||
text: "(?s).*tulis dan baca dengan tenang.*"
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "(?s).*pilih durasi.*"
|
||||
timeout: 10000
|
||||
- tapOn: "(?s).*5 menit.*"
|
||||
- tapOn: "(?s).*bayar Rp.*"
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "(?s).*cara bayar.*"
|
||||
timeout: 10000
|
||||
# Pick a payment method first — bayar CTA is disabled until one is
|
||||
# selected. QRIS is always in the "paling cepat" section.
|
||||
- tapOn: "QRIS"
|
||||
- tapOn:
|
||||
text: "(?s).*bayar Rp.*"
|
||||
retryTapIfNoChange: true
|
||||
# Brief settle so the POST /api/client/payment-requests/ completes
|
||||
# (creates the pending row before mark_latest_payment_paid runs).
|
||||
# Avoids asserting on QR/Xendit content since the visible screen
|
||||
# depends on XENDIT_ENABLED — we don't care which renders, just that
|
||||
# the payment row exists in the backend for the mark-paid script.
|
||||
- waitForAnimationToEnd:
|
||||
timeout: 5000
|
||||
- runScript:
|
||||
file: ../scripts/mark_latest_payment_paid.js
|
||||
env:
|
||||
BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL}
|
||||
- runFlow:
|
||||
when:
|
||||
visible:
|
||||
text: "(?s).*biar nggak ketinggalan.*"
|
||||
commands:
|
||||
- tapOn:
|
||||
text: "(?s).*nanti aja.*"
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "(?s).*lagi nyari bestie.*"
|
||||
timeout: 20000
|
||||
- runScript:
|
||||
file: ../scripts/mitra_accept_latest_internal.js
|
||||
env:
|
||||
MITRA_ID: ${output.MITRA_ID}
|
||||
BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL}
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "tulis sesuatu..."
|
||||
timeout: 20000
|
||||
|
||||
# ── Force expires_at → 0 so the floating expired banner appears ─────────
|
||||
- runScript:
|
||||
file: ../scripts/force_session_expires_at.js
|
||||
env:
|
||||
BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL}
|
||||
SECONDS_FROM_NOW: "0"
|
||||
|
||||
# The expired banner copy is "habis nih... mau lanjutin curhat sama X?".
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "(?s).*habis nih.*"
|
||||
timeout: 10000
|
||||
|
||||
# ── Step 1: tap "perpanjang" on the banner → time-up sheet opens ───────
|
||||
# Tap by Semantics identifier (id) — Maestro's tap-by-text and tap-by-point
|
||||
# both fail to trigger this ElevatedButton's onPressed (raw `adb input
|
||||
# tap` works, so it's a maestro/dadb gesture quirk specific to this
|
||||
# button). `id:` routes through the Android a11y framework's
|
||||
# performAction(CLICK), which fires onPressed cleanly. The matching
|
||||
# Semantics wrapper is in chat_expired_banner.dart.
|
||||
- tapOn:
|
||||
id: "chat_extend_button"
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "cukup, akhiri sesi"
|
||||
timeout: 20000
|
||||
|
||||
# ── Step 2: assert primary CTA also renders + sheet header ──────────────
|
||||
# Primary "perpanjang Rp..." renders as "pilih durasi dulu" before any
|
||||
# tier is selected; that's the relevant assertion for the 2-CTA layout.
|
||||
- assertVisible: "pilih durasi dulu"
|
||||
- assertVisible: "waktu curhat habis"
|
||||
|
||||
# ── Step 3: tap "cukup, akhiri sesi" → ConfirmEndStep1 popup ────────────
|
||||
- tapOn: "cukup, akhiri sesi"
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "yakin mau akhiri sesi?"
|
||||
timeout: 5000
|
||||
- assertVisible: "lanjut akhiri"
|
||||
- assertVisible: "gak jadi, balik"
|
||||
|
||||
# ── Step 4: tap "lanjut akhiri" → ConfirmEndStep2 popup ─────────────────
|
||||
- tapOn: "lanjut akhiri"
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "mau tinggalin pesan penutup?"
|
||||
timeout: 5000
|
||||
- assertVisible: "tulis pesan penutup"
|
||||
- assertVisible: "lewati saja"
|
||||
|
||||
# ── Step 5: tap "tulis pesan penutup" → ClosingMessageSheet ─────────────
|
||||
- tapOn: "tulis pesan penutup"
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "pesan penutup"
|
||||
timeout: 5000
|
||||
- assertVisible: "kirim & akhiri sesi"
|
||||
- assertVisible: "lewat — langsung akhiri"
|
||||
|
||||
# ── Step 6: type + send → closes session, navigates to /home ────────────
|
||||
- tapOn:
|
||||
text: "makasih ya bestie..."
|
||||
- inputText: "makasih bestie, sesi ini ngebantu banget"
|
||||
- hideKeyboard
|
||||
- tapOn: "kirim & akhiri sesi"
|
||||
|
||||
# Home is the landing zone after closure. Customer has seeded + just-ended
|
||||
# sessions in their history, so they're in the "returning" home variant —
|
||||
# CTA is "curhat sama bestie baru", not "aku mau curhat".
|
||||
- extendedWaitUntil:
|
||||
visible:
|
||||
text: "(?s).*curhat sama bestie baru.*"
|
||||
timeout: 15000
|
||||
Reference in New Issue
Block a user