Skip to content

Commit 0c90475

Browse files
committed
Add RN hardcoded buyer identity E2E smoke
1 parent f52bdca commit 0c90475

16 files changed

Lines changed: 193 additions & 44 deletions

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.

e2e/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
flows:
2-
- tests/**/*.yaml
2+
- tests/react-native/*.yaml
33

44
platform:
55
ios:
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: 5000
9+
- tapOn:
10+
id: product-0-grid-item
11+
- extendedWaitUntil:
12+
visible:
13+
id: add-to-cart-button
14+
timeout: 5000
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: 5000

e2e/flows/app/bootstrap-cart-from-link.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ appId: ${APP_ID}
99
# Reset app data before testing the deep-link cold-start path. The app is
1010
# stopped so openLink is the launch that seeds the cart.
1111
- stopApp
12-
- openLink: "${CART_BOOTSTRAP_LINK}"
12+
- openLink: "${CART_BOOTSTRAP_BASE_LINK}&buyerIdentityMode=${BUYER_IDENTITY_MODE}"
1313
- waitForAnimationToEnd
1414
- extendedWaitUntil:
1515
visible:
1616
id: checkout-button
17-
timeout: 30000
17+
timeout: 10000
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: 10000
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: 10000

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

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

44
env:
5+
# Sample app buyer identity configuration
6+
BUYER_IDENTITY_MODE: "guest"
7+
58
# Checkout contact fixture
69
EMAIL: "maestro.e2e@shopify.com"
710
FIRST_NAME: "Maestro"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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/bootstrap-cart-from-link.yaml
16+
- runFlow: ../../flows/checkout/present.yaml
17+
- runFlow: ../../flows/checkout/fill-payment-card.yaml
18+
- runFlow: ../../flows/checkout/submit.yaml
19+
- runFlow: ../../flows/checkout/assert-complete.yaml
20+
- runFlow: ../../flows/checkout/assert-returned-to-empty-cart.yaml

0 commit comments

Comments
 (0)