freshyo/tests/e2e/full-suite/user-journey.yaml
2026-10-05 20:43:25 +05:30

440 lines
11 KiB
YAML

# Suite steps 13-23: user leg — region gate, tags, slots, cart, offers+combo,
# checkout with new address, order, home glimpse.
appId: ${USER_APP_ID || "com.freshyotrial.app"}
env:
USER_APP_ID: ${USER_APP_ID || "com.freshyotrial.app"}
USER_MOBILE: ${USER_MOBILE || ""}
USER_PASSWORD: ${USER_PASSWORD || ""}
REGION_ID: ${REGION_ID || "1"}
P1: ${P1 || ""}
P2: ${P2 || ""}
COMBO: ${COMBO || ""}
TAG1: ${TAG1 || ""}
TAG2: ${TAG2 || ""}
TAG1_ID: ${TAG1_ID || ""}
TAG2_ID: ${TAG2_ID || ""}
P1SK0: ${P1SK0 || ""}
P2SK0: ${P2SK0 || ""}
SLOT1: ${SLOT1 || ""}
SLOT2: ${SLOT2 || ""}
SLOT3: ${SLOT3 || ""}
SLOT4: ${SLOT4 || ""}
SLOT5: ${SLOT5 || ""}
SLOT6: ${SLOT6 || ""}
SLOT7: ${SLOT7 || ""}
SLOT8: ${SLOT8 || ""}
SLOT_A: ${SLOT_A || ""}
SLOT_B: ${SLOT_B || ""}
STAMP: ${STAMP || ""}
tags:
- full-suite
- user
---
- launchApp:
# NOTE: no clearState — on iOS it deletes the app data container including
# Expo OTA state, which wedges the next boot on re-download (stuck at
# 'Downloading 100%'). clearKeychain alone resets cart/session (keychain).
clearKeychain: true
# Onboarding (first launch only).
- tapOn:
text: Next
optional: true
- waitForAnimationToEnd
# Location permission -> auto-detect gate.
- runFlow:
when:
visible:
text: 'Allow While Using App|Allow.*ocation'
commands:
- tapOn:
text: 'Allow While Using App|Allow.*ocation'
- extendedWaitUntil:
visible:
id: 'home-region-bar|region-gate-manual|region-gate-picker'
timeout: 60000
- runFlow:
when:
visible:
id: region-gate-manual
commands:
- tapOn:
id: region-gate-manual
- extendedWaitUntil:
visible:
id: 'region-pick-${REGION_ID}'
timeout: 15000
- tapOn:
id: 'region-pick-${REGION_ID}'
# Fresh installs land on the region picker when GPS auto-detect fails.
- runFlow:
when:
visible:
id: region-gate-picker
commands:
- tapOn:
id: 'region-pick-${REGION_ID}'
- extendedWaitUntil:
visible:
id: home-region-bar
timeout: 30000
# Steps 15-16: our 2 tags visible, products under the proper tags.
# Tag tabs live in a HORIZONTAL strip (ours sort last). Its vertical position
# shifts with page content, so swipe FROM a tab (not fixed points). The
# strip pins at the end; extra swipes no-op via optional once tabs scroll off.
- extendedWaitUntil:
visible:
id: tag-tab-9
timeout: 60000
- swipe:
from:
id: tag-tab-9
direction: LEFT
duration: 300
optional: true
- swipe:
from:
id: tag-tab-8
direction: LEFT
duration: 300
optional: true
- swipe:
from:
id: tag-tab-6
direction: LEFT
duration: 300
optional: true
- waitForAnimationToEnd
- assertVisible: ${TAG1}
- tapOn:
id: tag-tab-${TAG1_ID}
- extendedWaitUntil:
visible:
id: tag-grid-${TAG1_ID}
timeout: 15000
# Product cards expose concatenated accessibility text (name is not an exact
# textesa match), so verify product rows by their grid testIDs.
- scrollUntilVisible:
element:
id: tag-product-${P1SK0}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- assertVisible:
id: tag-product-${P1SK0}
# Strip auto-scrolls to the active tab; nudge from it for the adjacent tag.
- swipe:
from:
id: tag-tab-${TAG1_ID}
direction: LEFT
duration: 300
optional: true
- waitForAnimationToEnd
- assertVisible: ${TAG2}
- tapOn:
id: tag-tab-${TAG2_ID}
- extendedWaitUntil:
visible:
id: tag-grid-${TAG2_ID}
timeout: 15000
- scrollUntilVisible:
element:
id: tag-product-${P2SK0}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- assertVisible:
id: tag-product-${P2SK0}
# Step 18a: P1 into the first live slot (search -> Add to Cart -> slot dialog).
# Search result cards show an 'ADD TO CART' button (in-stock row first).
- tapOn:
id: home-search
- tapOn:
id: search-input-input
- eraseText
- setClipboard: ${P1}
- pasteText
- pressKey: enter
- extendedWaitUntil:
visible:
text: 'ADD TO CART'
timeout: 15000
- tapOn: 'ADD TO CART'
- extendedWaitUntil:
visible:
id: ${SLOT_A}
timeout: 20000
# Step 17: slots listed and in order (smoke check on the live pair; the full
# all-8 ordered verification lives in readback --slots).
- scrollUntilVisible:
element:
id: ${SLOT_B}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: ${SLOT_A}
direction: UP
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn:
id: ${SLOT_A}
- tapOn:
id: add-to-cart-confirm
# Step 18b: P2 into the second live slot.
- tapOn:
id: search-input-input
- eraseText
- setClipboard: ${P2}
- pasteText
- pressKey: enter
- extendedWaitUntil:
visible:
text: 'ADD TO CART'
timeout: 15000
- tapOn: 'ADD TO CART'
- extendedWaitUntil:
visible:
id: ${SLOT_B}
timeout: 20000
- tapOn:
id: ${SLOT_B}
- tapOn:
id: add-to-cart-confirm
# Step 19: combo into the first live slot (search single result, as 18a/18b),
# then visit Offers and verify the combo is listed there under Combos.
# (Screen-level UP scrolls near the tab bar risk tapping tabs — the flow
# never scrolls up on tab screens; step 20 continues via the floating
# Go to Cart bar.)
- tapOn: '^Home, tab, 1 of 5$'
- extendedWaitUntil:
visible:
id: home-search
timeout: 20000
- tapOn:
id: home-search
- tapOn:
id: search-input-input
- eraseText
- setClipboard: ${COMBO}
- pasteText
- pressKey: enter
- extendedWaitUntil:
visible:
text: 'ADD TO CART'
timeout: 15000
- tapOn: 'ADD TO CART'
- extendedWaitUntil:
visible:
id: ${SLOT_A}
timeout: 20000
- tapOn:
id: ${SLOT_A}
- tapOn:
id: add-to-cart-confirm
- tapOn: '^Offers, tab, 2 of 5$'
- extendedWaitUntil:
visible:
text: Combos
timeout: 20000
- tapOn:
text: 'Show More'
below:
text: Combos
- scrollUntilVisible:
element:
text: '.*${STAMP}.*'
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
# Step 20: cart -> checkout (login if redirected).
# The floating Go to Cart bar twice routed to the flash cart instead of the
# regular one — navigate by deep link (confirm sheet expected on iOS).
- openLink: 'freshyo://(drawer)/(tabs)/home/cart'
- runFlow:
when:
visible:
text: 'Open in.*'
commands:
- tapOn: Open
- scrollUntilVisible:
element:
id: checkout-button
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn:
id: checkout-button
- extendedWaitUntil:
visible:
id: 'user-login-mobile|Delivery Address'
timeout: 30000
- runFlow:
when:
visible:
id: user-login-mobile
commands:
- runFlow: subflows/login-user.yaml
- openLink: 'freshyo://(drawer)/(tabs)/home/cart'
- runFlow:
when:
visible:
text: 'Open in.*'
commands:
- tapOn: Open
# Step 21: ensure our address exists (create on first run; reruns reuse it),
# then select it (a previous default may still be selected).
- runFlow:
when:
visible:
text: '\+ Add New'
notVisible:
text: '.*E2E Customer.*'
commands:
- scrollUntilVisible:
element:
text: '\+ Add New'
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- retry:
maxRetries: 2
commands:
- tapOn:
text: '\+ Add New'
- extendedWaitUntil:
visible:
id: address-name
timeout: 20000
- tapOn:
id: address-name
- eraseText
- setClipboard: E2E Customer
- pasteText
- pressKey: Enter
- tapOn:
id: address-phone
- eraseText
- setClipboard: ${USER_MOBILE}
- pasteText
- pressKey: Enter
- tapOn:
id: address-line1
- eraseText
- setClipboard: E2E Test Street 1
- pasteText
- pressKey: Enter
- scrollUntilVisible:
element:
id: address-region-dropdown
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn:
id: address-region-dropdown
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: address-region-dropdown-option-${REGION_ID}
direction: DOWN
speed: 100
visibilityPercentage: 60
- waitForAnimationToEnd
- tapOn:
id: address-region-dropdown-option-${REGION_ID}
- waitForAnimationToEnd
- runFlow:
when:
visible:
id: address-region-dropdown-option-${REGION_ID}
commands:
- tapOn:
point: 50%,15%
- extendedWaitUntil:
notVisible:
id: address-region-dropdown-option-${REGION_ID}
timeout: 10000
- scrollUntilVisible:
element:
id: address-submit
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn:
id: address-submit
# The address section sits below the fold — scroll to it, verify ours saved,
# and tap it to select (a previous default may still be selected).
- scrollUntilVisible:
element:
text: '.*E2E Customer.*'
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn: '.*E2E Customer.*'
- waitForAnimationToEnd
# Now to checkout with the address auto-selected.
- scrollUntilVisible:
element:
id: checkout-button
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn:
id: checkout-button
- extendedWaitUntil:
notVisible:
text: 'No address selected'
timeout: 15000
# Step 22: place the order.
- scrollUntilVisible:
element:
id: place-order-button
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn:
id: place-order-button
- assertVisible: 'Order Placed Successfully!'
# Step 23: home order glimpse (Home tab resets scroll to top, glimpse sits
# below the search bar).
- tapOn: 'Continue Shopping'
- tapOn: '^Home, tab, 1 of 5$'
- extendedWaitUntil:
visible:
id: home-region-bar
timeout: 30000
- assertVisible: 'Upcoming Order'