freshyo/tests/e2e/full-suite/user-journey.yaml
2026-10-05 11:46:47 +05:30

388 lines
8.3 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 || ""}
SLOT1: ${SLOT1 || ""}
SLOT2: ${SLOT2 || ""}
SLOT3: ${SLOT3 || ""}
SLOT4: ${SLOT4 || ""}
SLOT5: ${SLOT5 || ""}
SLOT6: ${SLOT6 || ""}
SLOT7: ${SLOT7 || ""}
SLOT8: ${SLOT8 || ""}
tags:
- full-suite
- user
---
- launchApp:
clearState: 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}'
- 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). Maestro's directional
# scroll targets the vertical list, so page the strip with point swipes
# (verified geometry: strip sits ~47% height).
- repeat:
times: 4
commands:
- swipe:
start: 80%,47%
end: 20%,47%
duration: 300
- waitForAnimationToEnd
- assertVisible: ${TAG1}
- tapOn: ${TAG1}
- scrollUntilVisible:
element:
text: ${P1}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- assertVisible: ${P1}
- repeat:
times: 2
commands:
- swipe:
start: 80%,47%
end: 20%,47%
duration: 300
- waitForAnimationToEnd
- assertVisible: ${TAG2}
- tapOn: ${TAG2}
- scrollUntilVisible:
element:
text: ${P2}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- assertVisible: ${P2}
# Step 18a: P1 into slot 1 (search -> Add to Cart -> slot dialog).
- tapOn:
id: home-search
- tapOn:
id: search-input-input
- eraseText
- setClipboard: ${P1}
- pasteText
- pressKey: enter
- tapOn: 'Add to Cart'
- extendedWaitUntil:
visible:
id: ${SLOT1}
timeout: 20000
# Steps 17: all 8 slots listed, in order.
- scrollUntilVisible:
element:
id: ${SLOT2}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: ${SLOT3}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: ${SLOT4}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: ${SLOT5}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: ${SLOT6}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: ${SLOT7}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: ${SLOT8}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- scrollUntilVisible:
element:
id: ${SLOT1}
direction: UP
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn:
id: ${SLOT1}
- tapOn:
id: add-to-cart-confirm
# Step 18b: P2 into slot 2.
- tapOn:
id: search-input-input
- eraseText
- setClipboard: ${P2}
- pasteText
- pressKey: enter
- tapOn: 'Add to Cart'
- extendedWaitUntil:
visible:
id: ${SLOT2}
timeout: 20000
- tapOn:
id: ${SLOT2}
- tapOn:
id: add-to-cart-confirm
# Step 19: Offers tab -> combo -> cart (into slot 1).
- tapOn: Offers
- extendedWaitUntil:
visible:
text: Combos
timeout: 20000
- scrollUntilVisible:
element:
text: ${COMBO}
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn: ${COMBO}
- extendedWaitUntil:
visible:
id: add-to-cart-icon
timeout: 20000
- tapOn:
id: add-to-cart-icon
- extendedWaitUntil:
visible:
id: ${SLOT1}
timeout: 20000
- tapOn:
id: ${SLOT1}
- tapOn:
id: add-to-cart-confirm
# Step 20: cart -> checkout (login if redirected).
- extendedWaitUntil:
visible:
id: go-to-cart
timeout: 20000
- tapOn:
id: go-to-cart
- scrollUntilVisible:
element:
id: checkout-button
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- tapOn:
id: checkout-button
- extendedWaitUntil:
visible:
id: 'user-login-mobile|address-option-0|No addresses found|Add Address'
timeout: 30000
- runFlow:
when:
visible:
id: user-login-mobile
commands:
- runFlow: subflows/login-user.yaml
- extendedWaitUntil:
visible:
id: go-to-cart
timeout: 20000
- tapOn:
id: go-to-cart
- scrollUntilVisible:
element:
id: checkout-button
direction: DOWN
speed: 100
visibilityPercentage: 60
centerElement: true
- tapOn:
id: checkout-button
- extendedWaitUntil:
visible:
id: 'address-option-0|No addresses found|Add Address'
timeout: 30000
# Step 21: add an address (auto-selected on save).
- tapOn:
text: '\+ Add New|Add Address'
optional: true
- 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
# Step 22: place the order.
- extendedWaitUntil:
visible:
id: place-order-button
timeout: 30000
- 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.
- tapOn: 'Continue Shopping'
- extendedWaitUntil:
visible:
id: home-region-bar
timeout: 30000
- scrollUntilVisible:
element:
text: 'Upcoming Order'
direction: UP
speed: 100
visibilityPercentage: 60
centerElement: true
- waitForAnimationToEnd
- assertVisible: 'Upcoming Order'