Phase 4 Stage 7: end-of-session 2-step confirm + thank-you screen

Customer-driven session end flow:
- AppBar 'akhiri' action on chat_screen (visible when connected and
  not already closing).
- Tap fires confirm_end_step1 HaloPopup. lanjut akhiri -> step2;
  gak jadi balik -> dismiss, stay in chat.
- confirm_end_step2 HaloPopup. tulis pesan penutup -> closing_message_sheet
  HaloBottomSheet (textarea + kirim & akhiri / lewat — langsung akhiri).
  lewati saja closes immediately.
- Both close paths POST /api/client/session/:sessionId/end via
  session_closure_notifier.closeSession() and route to /chat/thank-you.
- 409 from the close endpoint surfaces a ClosureRejectedByMitraData
  state and a stub HaloPopup with TODO(stage8) for the BestieOfflinePopup
  returning variant.

Removed the legacy _showSessionExpiredDialog modal — Stage 6's
ChatExpiredBanner is the replacement notification.

Inline _buildGoodbyeView retained with a TODO for the mitra-side early
end flow (still reaches it).

endSessionTwoStepConfirmProvider hardcoded to true with a TODO — the
Stage 1.5 app_config row exists but no client-readable config endpoint
exists yet. Flip the provider to a FutureProvider once the read endpoint
ships.

Maestro 07_end_session_2step.yaml chains after the chat-happy flow
and asserts the Indonesian copy at each step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 17:33:01 +08:00
parent 14b5cc966b
commit d454fd39db
9 changed files with 480 additions and 42 deletions

View File

@@ -0,0 +1,76 @@
# Stage 7 acceptance: customer-initiated end-of-session 2-step flow.
#
# Flow:
# 1. Customer is on the chat screen of an ACTIVE session (run flow 03 first).
# 2. Tap "akhiri" in the AppBar → step-1 confirm popup ("yakin mau akhiri sesi?").
# 3. Tap "lanjut akhiri" → step-2 confirm popup ("mau tinggalin pesan penutup?").
# 4. Tap "tulis pesan penutup" → closing-message bottom sheet.
# 5. Type a message → "kirim & akhiri sesi" → POSTs goodbye + closes session.
# 6. Verify navigation to S11 thank-you screen ("makasih udah curhat").
# 7. Tap "balik ke home" → home screen ("Mulai Curhat").
#
# Pre-req:
# 1. A live chat session is on screen (paired + active). Chain after flow
# 03_payment_to_chat_happy.yaml.
#
# Run (chained):
# maestro test client_app/.maestro/flows/03_payment_to_chat_happy.yaml \
# client_app/.maestro/flows/07_end_session_2step.yaml
appId: ${APP_ID_ANDROID}
---
- launchApp:
clearState: false
# Step 0: assert we're on the chat screen.
- extendedWaitUntil:
visible:
text: "Ketik Pesan"
timeout: 10000
# Step 1: tap "akhiri" in the AppBar → step-1 popup.
- tapOn: "akhiri"
- extendedWaitUntil:
visible:
text: "yakin mau akhiri sesi?"
timeout: 5000
- assertVisible: "lanjut akhiri"
- assertVisible: "gak jadi, balik"
# Step 2: tap "lanjut akhiri" → step-2 popup.
- tapOn: "lanjut akhiri"
- extendedWaitUntil:
visible:
text: "mau tinggalin pesan penutup?"
timeout: 5000
- assertVisible: "tulis pesan penutup"
- assertVisible: "lewati saja"
# Step 3: tap "tulis pesan penutup" → closing-message bottom sheet.
- tapOn: "tulis pesan penutup"
- extendedWaitUntil:
visible:
text: "pesan penutup"
timeout: 5000
- assertVisible: "kirim & akhiri sesi"
- assertVisible: "lewat — langsung akhiri"
# Step 4: type a message + send.
- tapOn:
text: "makasih ya bestie..."
- inputText: "makasih bestie, sesi ini ngebantu banget"
- hideKeyboard
- tapOn: "kirim & akhiri sesi"
# Step 5: verify S11 thank-you screen.
- extendedWaitUntil:
visible:
text: "makasih udah curhat"
timeout: 10000
- assertVisible: "balik ke home"
# Step 6: tap "balik ke home" → home.
- tapOn: "balik ke home"
- extendedWaitUntil:
visible:
text: "Mulai Curhat"
timeout: 5000