Skip to content

Commit 1d64a24

Browse files
committed
Add RN hardcoded buyer identity E2E smoke
1 parent 7c46cb0 commit 1d64a24

10 files changed

Lines changed: 93 additions & 11 deletions

File tree

e2e/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ This directory contains Maestro end-to-end smoke flows for Checkout Kit sample
44
apps.
55

66
The current runnable suite starts with React Native. It verifies a full guest
7-
checkout from a seeded cart in the sample app, through Shopify checkout, and
8-
back to the app after completion.
7+
checkout from a seeded cart and a hardcoded buyer identity checkout created
8+
through the sample app, through Shopify checkout, and back to the app after
9+
completion.
910

1011
## Run locally
1112

@@ -35,13 +36,15 @@ sample cart setup is required.
3536

3637
- `config.yaml` configures Maestro for shared platform behavior.
3738
- `flows/` contains reusable Maestro subflows for app setup and checkout steps.
38-
- `tests/react-native/full-guest-checkout.yaml` composes the React Native guest
39+
- `tests/react-native/checkout-guest.yaml` composes the React Native guest
3940
checkout smoke test from those subflows.
41+
- `tests/react-native/checkout-hardcoded-buyer-identity.yaml` verifies the RN
42+
sample can create a checkout from a cart with hardcoded buyer identity.
4043

4144
## Scope
4245

4346
This smoke flow is intended to catch regressions in the React Native sample app
44-
integration surface: cart bootstrap, checkout presentation, checkout
45-
completion, and return to the sample app. It is not a replacement for
46-
checkout-web's browser-based coverage or for future native Swift and Android
47-
sample-app E2E coverage.
47+
integration surface: cart bootstrap, buyer identity configuration, checkout
48+
presentation, checkout completion, and return to the sample app. It is not a
49+
replacement for checkout-web's browser-based coverage or for future native
50+
Swift and Android sample-app E2E coverage.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
appId: ${APP_ID}
2+
---
3+
- tapOn:
4+
id: catalog-tab
5+
- extendedWaitUntil:
6+
visible:
7+
id: product-0-grid-item
8+
timeout: 30000
9+
- tapOn:
10+
id: product-0-grid-item
11+
- extendedWaitUntil:
12+
visible:
13+
id: add-to-cart-button
14+
timeout: 30000
15+
- tapOn:
16+
id: add-to-cart-button
17+
enabled: true
18+
- tapOn:
19+
id: cart-tab
20+
- extendedWaitUntil:
21+
visible:
22+
id: checkout-button
23+
timeout: 30000
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
appId: ${APP_ID}
2+
---
3+
- runFlow:
4+
when:
5+
visible: "Open debugger to view warnings."
6+
commands:
7+
- tapOn:
8+
point: "92%,92%"
9+
- waitForAnimationToEnd

e2e/flows/app/launch.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ appId: ${APP_ID}
1010
visible:
1111
id: checkout-kit-sample-ready
1212
timeout: 60000
13+
- runFlow: dismiss-dev-warning.yaml
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
appId: ${APP_ID}
2+
---
3+
- tapOn:
4+
id: settings-tab
5+
- waitForAnimationToEnd
6+
- runFlow:
7+
when:
8+
notVisible:
9+
id: settings-section-authentication
10+
commands:
11+
- tapOn:
12+
id: settings-tab
13+
- waitForAnimationToEnd
14+
- extendedWaitUntil:
15+
visible:
16+
id: settings-section-authentication
17+
timeout: 10000
18+
- tapOn:
19+
id: "settings-buyer-identity-option-${BUYER_IDENTITY_MODE}"
20+
- waitForAnimationToEnd

e2e/flows/checkout/present.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ appId: ${APP_ID}
55
enabled: true
66
- extendedWaitUntil:
77
visible:
8-
text: "^Email( or mobile phone number)?$"
8+
text: "^(Email( or mobile phone number)?|Delivery|Card number)$"
99
timeout: 60000

e2e/tests/react-native/full-guest-checkout.yaml renamed to e2e/tests/react-native/checkout-guest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
appId: ${APP_ID}
2-
name: React Native full guest checkout
2+
name: React Native checkout - guest
33

44
env:
55
# Checkout contact fixture
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
appId: ${APP_ID}
2+
name: React Native checkout - hardcoded buyer identity
3+
4+
env:
5+
# Sample app buyer identity configuration
6+
BUYER_IDENTITY_MODE: "hardcoded"
7+
8+
# Checkout payment fixture
9+
CARD_NUMBER: "1"
10+
CARD_SECURITY_CODE: "123"
11+
12+
# Accepted successful checkout states for this smoke test.
13+
POST_SUBMIT_RESULT_PATTERN: ".*(Thank you|Your order|Order confirmed|confirmation).*"
14+
---
15+
- runFlow: ../../flows/app/launch.yaml
16+
- runFlow: ../../flows/app/select-buyer-identity.yaml
17+
- extendedWaitUntil:
18+
visible:
19+
id: settings-buyer-identity-details
20+
timeout: 5000
21+
- runFlow: ../../flows/app/add-first-product-to-cart.yaml
22+
- runFlow: ../../flows/checkout/present.yaml
23+
- runFlow: ../../flows/checkout/fill-payment-card.yaml
24+
- runFlow: ../../flows/checkout/submit.yaml
25+
- runFlow: ../../flows/checkout/assert-complete.yaml
26+
- runFlow: ../../flows/checkout/assert-returned-to-empty-cart.yaml

platforms/react-native/scripts/e2e_maestro_android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ pnpm sample android --local --extra-params "--refresh-dependencies"
5555
maestro --platform android test --config ../../e2e/config.yaml \
5656
-e "APP_ID=${APP_ID}" \
5757
-e "CART_BOOTSTRAP_LINK=${CART_BOOTSTRAP_LINK}" \
58-
../../e2e/tests/react-native/full-guest-checkout.yaml
58+
../../e2e/tests/react-native

platforms/react-native/scripts/e2e_maestro_ios

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ pnpm sample ios --local
5555
maestro --platform ios test --config ../../e2e/config.yaml \
5656
-e "APP_ID=${APP_ID}" \
5757
-e "CART_BOOTSTRAP_LINK=${CART_BOOTSTRAP_LINK}" \
58-
../../e2e/tests/react-native/full-guest-checkout.yaml
58+
../../e2e/tests/react-native

0 commit comments

Comments
 (0)