Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ ruby e2e/scripts/e2e_matrix_to_browserstack_run_plan count
- `tests/shared/launch-smoke.yaml` is the shared launch smoke test.
- `tests/shared/checkout-present-and-close.yaml` seeds a cart through the control
link, presents checkout, closes it, and asserts dismissal.
- `tests/react-native/checkout-guest.yaml` composes the React Native guest
checkout smoke test from those subflows.
- `tests/react-native/checkout-hardcoded-buyer-identity.yaml` verifies checkout
from a bootstrapped cart with hardcoded buyer identity.
- `tests/shared/checkout-hardcoded-buyer-identity.yaml` orders from a cart that
already carries the contact and the delivery address.
- `tests/shared/checkout-guest.yaml` orders from an empty identity, so checkout
asks for the contact and the delivery address as well as the payment.
- `scripts/run_local_e2e` builds and installs any of the four local targets.
- `scripts/run_maestro` is their single Maestro invocation. It holds the
environment contract and target-specific test-file selection in one place.
Expand Down
10 changes: 1 addition & 9 deletions e2e/flows/app/hide-keyboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ appId: ${E2E_APP_ID}
- runFlow:
when:
platform: ios
visible: "Done"
commands:
- tapOn: "Done"
- waitForAnimationToEnd
- runFlow:
when:
platform: ios
visible: "selected"
commands:
- tapOn: "selected"
- tapOn: "^(Done|selected)$"
- waitForAnimationToEnd
42 changes: 42 additions & 0 deletions e2e/flows/checkout/assert-hosted-text-field-value.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
appId: ${E2E_APP_ID}
---
- runFlow:
when:
platform: ios
commands:
- scrollUntilVisible:
element:
text: "^Field container for: ${FIELD_LABEL}$"
direction: UP
centerElement: true
- runFlow:
when:
true: ${HAS_NEXT_FIELD == 'true'}
commands:
- extendedWaitUntil:
visible:
text: "^${EXPECTED_TEXT}$"
below:
text: "^${FIELD_LABEL}$"
above:
text: "^${NEXT_FIELD_LABEL}$"
- runFlow:
when:
true: ${HAS_NEXT_FIELD == 'false'}
commands:
- extendedWaitUntil:
visible:
text: "^${EXPECTED_TEXT}$"
below:
text: "^${FIELD_LABEL}$"
- runFlow:
when:
platform: android
commands:
- scrollUntilVisible:
element:
text: "^${FIELD_LABEL}$"
direction: UP
centerElement: true
- extendedWaitUntil:
visible: "^${EXPECTED_TEXT}$"
6 changes: 0 additions & 6 deletions e2e/flows/checkout/dismiss-active-field.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
appId: ${E2E_APP_ID}
---
- runFlow: ../app/hide-keyboard.yaml
- runFlow:
when:
visible: "Close suggestions"
commands:
- tapOn: "Close suggestions"
- waitForAnimationToEnd
57 changes: 28 additions & 29 deletions e2e/flows/checkout/fill-billing-address.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
appId: ${E2E_APP_ID}
---
# Checkout offers a "use the shipping address" control only when it can copy the address
# the cart supplied. The samples build their carts through different mutations, so one
# target gets the control and another gets an empty billing form. The scroll below stops
# at whichever the target shows, and the branch fills the form only when there is one.
# Checkout may offer the shipping address or display an open billing form. Stop at
# whichever state the journey presents and fill the form only when it is open.
- scrollUntilVisible:
element:
text: "^(Billing address|Use shipping address as billing address)$"
Expand All @@ -15,29 +13,30 @@ appId: ${E2E_APP_ID}
commands:
# Country/Region and Province already hold the shop defaults, so this flow leaves
# them alone and supplies an address that suits those defaults.
- scrollUntilVisible:
element:
text: "^First name( \\(optional\\))?$"
direction: DOWN
centerElement: true
- tapOn:
text: "^First name( \\(optional\\))?$"
- inputText: "${BILLING_FIRST_NAME}"
- runFlow: dismiss-active-field.yaml
- tapOn:
text: "^Last name$"
- inputText: "${BILLING_LAST_NAME}"
- runFlow: dismiss-active-field.yaml
- tapOn:
text: "^Address$"
- inputText: "${BILLING_ADDRESS_LINE1}"
- runFlow: dismiss-active-field.yaml
- tapOn:
text: "^City$"
- inputText: "${BILLING_CITY}"
- runFlow: dismiss-active-field.yaml
- tapOn:
text: "^${BILLING_POSTAL_FIELD_LABEL}$"
- inputText: "${BILLING_POSTAL_CODE}"
- runFlow: dismiss-active-field.yaml
- runFlow:
file: fill-text-field.yaml
env:
LOCATOR: "^First name( \\(optional\\))?$"
TEXT_TO_INPUT: "${BILLING_FIRST_NAME}"
- runFlow:
file: fill-text-field.yaml
env:
LOCATOR: "^Last name$"
TEXT_TO_INPUT: "${BILLING_LAST_NAME}"
- runFlow:
file: fill-text-field.yaml
env:
LOCATOR: "^Address$"
TEXT_TO_INPUT: "${BILLING_ADDRESS_LINE1}"
DISMISS_SUGGESTIONS: "true"
- runFlow:
file: fill-text-field.yaml
env:
LOCATOR: "^City$"
TEXT_TO_INPUT: "${BILLING_CITY}"
- runFlow:
file: fill-text-field.yaml
env:
LOCATOR: "^${BILLING_POSTAL_FIELD_LABEL}$"
TEXT_TO_INPUT: "${BILLING_POSTAL_CODE}"
- waitForAnimationToEnd
16 changes: 0 additions & 16 deletions e2e/flows/checkout/fill-contact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,3 @@ appId: ${E2E_APP_ID}
- runFlow: dismiss-active-field.yaml
- extendedWaitUntil:
visible: "^${EMAIL}$"
- tapOn:
text: "^First name( \\(optional\\))?$"
- waitForAnimationToEnd
- inputText: "${FIRST_NAME}"
- runFlow: dismiss-active-field.yaml
- scrollUntilVisible:
element:
text: "^Last name$"
direction: DOWN
visibilityPercentage: 100
centerElement: true
- tapOn:
text: "^Last name$"
- waitForAnimationToEnd
- inputText: "${LAST_NAME}"
- runFlow: dismiss-active-field.yaml
39 changes: 39 additions & 0 deletions e2e/flows/checkout/fill-hosted-text-field.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
appId: ${E2E_APP_ID}
---
- runFlow:
when:
platform: ios
commands:
- runFlow:
when:
true: ${SCROLL_TO_FIELD == 'true'}
commands:
- runFlow:
file: scroll-until-visible-bidirectional.yaml
env:
LOCATOR: "^Field container for: ${FIELD_LABEL}$"
INITIAL_DIRECTION: "DOWN"
# The first post-scroll tap positions the hosted container. The second gives
# its iframe input focus before text entry.
- tapOn:
text: "^Field container for: ${FIELD_LABEL}$"
- waitForAnimationToEnd
- tapOn:
text: "^Field container for: ${FIELD_LABEL}$"
- runFlow:
when:
platform: android
commands:
- runFlow:
when:
true: ${SCROLL_TO_FIELD == 'true'}
commands:
- runFlow:
file: scroll-until-visible-bidirectional.yaml
env:
LOCATOR: "^${FIELD_LABEL}$"
INITIAL_DIRECTION: "DOWN"
- tapOn:
text: "^${FIELD_LABEL}$"
- waitForAnimationToEnd
- inputText: "${TEXT_TO_INPUT}"
104 changes: 72 additions & 32 deletions e2e/flows/checkout/fill-payment-card.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,81 @@
appId: ${E2E_APP_ID}
---
- scrollUntilVisible:
element:
text: "^Card number$"
direction: DOWN
centerElement: true
- tapOn:
text: "^Card number$"
- waitForAnimationToEnd
- inputText: "${CARD_NUMBER}"
# Checkout groups the digits, so the field never reads back the value the test typed.
- extendedWaitUntil:
visible: "^${CARD_NUMBER_DISPLAY}$"
- runFlow: dismiss-active-field.yaml
- scrollUntilVisible:
element:
text: "^Expiration date \\(MM / YY\\)$"
direction: DOWN
centerElement: true
- tapOn:
text: "^Expiration date \\(MM / YY\\)$"
- waitForAnimationToEnd
- inputText: "1"
# Enter Card number and dismiss its keyboard before moving to Expiration.
- runFlow:
file: fill-hosted-text-field.yaml
env:
FIELD_LABEL: "Card number"
SCROLL_TO_FIELD: "true"
TEXT_TO_INPUT: "${CARD_NUMBER}"
- runFlow:
when:
platform: ios
visible: "^(Done|selected)$"
commands:
- runFlow: dismiss-active-field.yaml

# Enter expiration in two pairs so Checkout has time to format the separator.
- runFlow:
file: fill-hosted-text-field.yaml
env:
FIELD_LABEL: "Expiration date \\(MM / YY\\)"
SCROLL_TO_FIELD: "false"
TEXT_TO_INPUT: "1"
- inputText: "2"
- waitForAnimationToEnd
- inputText: "3"
- inputText: "0"
- runFlow: dismiss-active-field.yaml
- tapOn:
text: "^Security code$"
- waitForAnimationToEnd
- inputText: "${CARD_SECURITY_CODE}"
- runFlow: dismiss-active-field.yaml
- tapOn:
text: "^Name on card$"
- waitForAnimationToEnd
- eraseText
- inputText: "${CARD_HOLDER_NAME}"

- runFlow:
file: fill-hosted-text-field.yaml
env:
FIELD_LABEL: "Security code"
SCROLL_TO_FIELD: "false"
TEXT_TO_INPUT: "${CARD_SECURITY_CODE}"
- runFlow: dismiss-active-field.yaml

# Preserve Checkout's cardholder prefill and only supply the name when it is absent.
- runFlow:
when:
notVisible:
text: "^${CARD_HOLDER_NAME}$"
below:
text: "^Security code$"
commands:
- tapOn:
text: "^Name on card$"
- waitForAnimationToEnd
- inputText: "${CARD_HOLDER_NAME}"
- runFlow: dismiss-active-field.yaml

# Validate every hosted field from the bottom up after input is complete.
- runFlow:
file: assert-hosted-text-field-value.yaml
env:
FIELD_LABEL: "Name on card"
NEXT_FIELD_LABEL: ""
HAS_NEXT_FIELD: "false"
EXPECTED_TEXT: "${CARD_HOLDER_NAME}"
- runFlow:
file: assert-hosted-text-field-value.yaml
env:
FIELD_LABEL: "Security code"
NEXT_FIELD_LABEL: "Name on card"
HAS_NEXT_FIELD: "true"
EXPECTED_TEXT: "${CARD_SECURITY_CODE}"
- runFlow:
file: assert-hosted-text-field-value.yaml
env:
FIELD_LABEL: "Expiration date \\(MM / YY\\)"
NEXT_FIELD_LABEL: "Security code"
HAS_NEXT_FIELD: "true"
EXPECTED_TEXT: "12 / 30"
- runFlow:
file: assert-hosted-text-field-value.yaml
env:
FIELD_LABEL: "Card number"
NEXT_FIELD_LABEL: "Expiration date \\(MM / YY\\)"
HAS_NEXT_FIELD: "true"
EXPECTED_TEXT: "${CARD_NUMBER_DISPLAY}"
- waitForAnimationToEnd
Loading
Loading