Skip to content

Commit 854eb9b

Browse files
committed
Add RN Maestro guest checkout subflows
1 parent 1a7c432 commit 854eb9b

11 files changed

Lines changed: 307 additions & 0 deletions

e2e/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
flows:
2+
- tests/**/*.yaml
3+
4+
platform:
5+
ios:
6+
# Lets Maestro inspect elements presented inside iOS checkout modal views.
7+
snapshotKeyHonorModalViews: true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
appId: ${APP_ID}
2+
---
3+
- stopApp
4+
- openLink: "${CART_BOOTSTRAP_LINK}"
5+
- runFlow:
6+
when:
7+
visible: "Open"
8+
commands:
9+
- tapOn: "Open"
10+
- extendedWaitUntil:
11+
visible:
12+
id: checkout-button
13+
timeout: 30000

e2e/flows/app/launch.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
appId: ${APP_ID}
2+
---
3+
- launchApp:
4+
clearState: true
5+
arguments:
6+
# iOS-only launch arguments; Android ignores them.
7+
AppleLocale: en_US
8+
AppleLanguages: "(en)"
9+
- extendedWaitUntil:
10+
visible:
11+
id: checkout-kit-sample-ready
12+
timeout: 60000
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
appId: ${APP_ID}
2+
---
3+
- extendedWaitUntil:
4+
visible: "${POST_SUBMIT_RESULT_PATTERN}"
5+
timeout: 60000
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
appId: ${APP_ID}
2+
---
3+
- tapOn: "Close Checkout"
4+
- runFlow:
5+
when:
6+
visible:
7+
id: catalog-tab
8+
commands:
9+
- tapOn:
10+
id: cart-tab
11+
- extendedWaitUntil:
12+
visible:
13+
id: cart-empty-message
14+
timeout: 15000
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
appId: ${APP_ID}
2+
---
3+
- tapOn:
4+
text: "^Email( or mobile phone number)?$"
5+
- inputText: "${EMAIL}"
6+
- runFlow:
7+
when:
8+
visible: "selected"
9+
commands:
10+
- tapOn: "selected"
11+
- extendedWaitUntil:
12+
visible: "^${EMAIL}$"
13+
- scrollUntilVisible:
14+
element:
15+
text: "^First name( \\(optional\\))?$"
16+
direction: DOWN
17+
visibilityPercentage: 100
18+
centerElement: true
19+
- tapOn:
20+
text: "^First name( \\(optional\\))?$"
21+
- inputText: "${FIRST_NAME}"
22+
- runFlow:
23+
when:
24+
visible: "selected"
25+
commands:
26+
- tapOn: "selected"
27+
- scrollUntilVisible:
28+
element:
29+
text: "^Last name$"
30+
direction: DOWN
31+
visibilityPercentage: 100
32+
centerElement: true
33+
- tapOn:
34+
text: "^Last name$"
35+
- inputText: "${LAST_NAME}"
36+
- runFlow:
37+
when:
38+
visible: "selected"
39+
commands:
40+
- tapOn: "selected"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
appId: ${APP_ID}
2+
---
3+
- scrollUntilVisible:
4+
element:
5+
text: "^Card number$"
6+
direction: DOWN
7+
centerElement: true
8+
- tapOn:
9+
text: "^Card number$"
10+
index: -1
11+
- inputText: "${CARD_NUMBER}"
12+
- runFlow:
13+
when:
14+
visible: "selected"
15+
commands:
16+
- tapOn: "selected"
17+
- scrollUntilVisible:
18+
element:
19+
text: "^Expiration date \\(MM / YY\\)$"
20+
direction: DOWN
21+
centerElement: true
22+
- tapOn:
23+
text: "^Expiration date \\(MM / YY\\)$"
24+
index: -1
25+
- inputText: "1"
26+
- waitForAnimationToEnd
27+
- inputText: "2"
28+
- waitForAnimationToEnd
29+
- inputText: "3"
30+
- waitForAnimationToEnd
31+
- inputText: "0"
32+
- runFlow:
33+
when:
34+
visible: "selected"
35+
commands:
36+
- tapOn: "selected"
37+
- scrollUntilVisible:
38+
element:
39+
text: "^Security code$"
40+
direction: DOWN
41+
centerElement: true
42+
- tapOn:
43+
text: "^Security code$"
44+
index: -1
45+
- inputText: "${CARD_SECURITY_CODE}"
46+
- runFlow:
47+
when:
48+
visible: "selected"
49+
commands:
50+
- tapOn: "selected"
51+
- waitForAnimationToEnd
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
appId: ${APP_ID}
2+
---
3+
- scrollUntilVisible:
4+
element:
5+
text: "Country/Region"
6+
direction: DOWN
7+
- tapOn:
8+
text: "Country/Region"
9+
index: 1
10+
- waitForAnimationToEnd
11+
- scrollUntilVisible:
12+
element:
13+
text: "^${COUNTRY_LABEL}$"
14+
direction: UP
15+
visibilityPercentage: 10
16+
optional: true
17+
- scrollUntilVisible:
18+
element:
19+
text: "^${COUNTRY_LABEL}$"
20+
direction: DOWN
21+
visibilityPercentage: 10
22+
optional: true
23+
- tapOn:
24+
text: "^${COUNTRY_LABEL}$"
25+
- waitForAnimationToEnd
26+
- scrollUntilVisible:
27+
element:
28+
text: "Address"
29+
direction: DOWN
30+
- tapOn:
31+
text: "Address"
32+
index: -1
33+
- eraseText: 80
34+
- inputText: "${ADDRESS_LINE1}"
35+
- runFlow:
36+
when:
37+
visible: "selected"
38+
commands:
39+
- tapOn: "selected"
40+
- runFlow:
41+
when:
42+
visible: "Close suggestions"
43+
commands:
44+
- tapOn: "Close suggestions"
45+
- waitForAnimationToEnd
46+
- scrollUntilVisible:
47+
element:
48+
text: "^City$"
49+
direction: DOWN
50+
centerElement: true
51+
- tapOn:
52+
text: "^City$"
53+
index: -1
54+
- eraseText: 80
55+
- inputText: "${CITY}"
56+
- runFlow:
57+
when:
58+
visible: "selected"
59+
commands:
60+
- tapOn: "selected"
61+
- tapOn: "^Delivery$"
62+
- waitForAnimationToEnd
63+
- scrollUntilVisible:
64+
element:
65+
text: "^${STATE_FIELD_LABEL}$"
66+
direction: DOWN
67+
centerElement: true
68+
- runFlow:
69+
when:
70+
notVisible: "^${STATE_LABEL}$"
71+
commands:
72+
- tapOn:
73+
containsChild:
74+
text: "^${STATE_FIELD_LABEL}$"
75+
- waitForAnimationToEnd
76+
- scrollUntilVisible:
77+
element:
78+
text: "^${STATE_LABEL}$"
79+
direction: UP
80+
visibilityPercentage: 100
81+
optional: true
82+
- scrollUntilVisible:
83+
element:
84+
text: "^${STATE_LABEL}$"
85+
direction: DOWN
86+
visibilityPercentage: 100
87+
optional: true
88+
- tapOn:
89+
text: "^${STATE_LABEL}$"
90+
- waitForAnimationToEnd
91+
- extendedWaitUntil:
92+
notVisible: "Select a state"
93+
- extendedWaitUntil:
94+
visible: "^${STATE_LABEL}$"
95+
- scrollUntilVisible:
96+
element:
97+
text: "^${POSTAL_FIELD_LABEL}$"
98+
direction: DOWN
99+
centerElement: true
100+
- tapOn:
101+
text: "^${POSTAL_FIELD_LABEL}$"
102+
index: -1
103+
- eraseText: 80
104+
- inputText: "${POSTAL_CODE}"
105+
- runFlow:
106+
when:
107+
visible: "selected"
108+
commands:
109+
- tapOn: "selected"
110+
- extendedWaitUntil:
111+
visible: "^${POSTAL_CODE}$"
112+
- waitForAnimationToEnd

e2e/flows/checkout/present.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
appId: ${APP_ID}
2+
---
3+
- tapOn:
4+
id: checkout-button
5+
enabled: true
6+
- extendedWaitUntil:
7+
visible:
8+
text: "^Email( or mobile phone number)?$"
9+
timeout: 60000

e2e/flows/checkout/submit.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
appId: ${APP_ID}
2+
---
3+
- scrollUntilVisible:
4+
element:
5+
text: "^(Pay now|Complete order)$"
6+
direction: DOWN
7+
visibilityPercentage: 90
8+
- tapOn:
9+
text: "^(Pay now|Complete order)$"
10+
enabled: true

0 commit comments

Comments
 (0)