|
| 1 | +appId: com.shopify.example.CheckoutKitReactNative |
| 2 | +name: Checkout submits and shows result |
| 3 | +tags: |
| 4 | + - ios |
| 5 | + - checkout |
| 6 | + |
| 7 | +env: |
| 8 | + PRODUCT_INDEX: "0" |
| 9 | + |
| 10 | + # Checkout contact fixture |
| 11 | + EMAIL: "maestro.e2e@shopify.com" |
| 12 | + FIRST_NAME: "Maestro" |
| 13 | + LAST_NAME: "Shopify" |
| 14 | + |
| 15 | + # Checkout shipping fixture |
| 16 | + COUNTRY_LABEL: "United States" |
| 17 | + ADDRESS_LINE1: "700 S Flower St" |
| 18 | + CITY: "Los Angeles" |
| 19 | + STATE_FIELD_LABEL: "State" |
| 20 | + STATE_LABEL: "California" |
| 21 | + POSTAL_CODE: "90017" |
| 22 | + POSTAL_FIELD_LABEL: "ZIP code" |
| 23 | + |
| 24 | + # Checkout payment fixture |
| 25 | + CARD_NUMBER: "1" |
| 26 | + CARD_EXPIRY: "1230" |
| 27 | + CARD_SECURITY_CODE: "123" |
| 28 | + |
| 29 | + # Accepted successful checkout states for this smoke test. |
| 30 | + POST_SUBMIT_RESULT_PATTERN: ".*(Thank you|Your order|Order confirmed|confirmation).*" |
| 31 | +--- |
| 32 | +# Timeout tiers: |
| 33 | +# 3000 - animation settles |
| 34 | +# 5000 - local in-page interactions and optional probes |
| 35 | +# 15000 - sample-app checkout transitions |
| 36 | +# 60000 - cold starts, first checkout paint, final submit |
| 37 | + |
| 38 | +# Product and cart |
| 39 | +- launchApp: |
| 40 | + clearState: true |
| 41 | + arguments: |
| 42 | + AppleLocale: en_US |
| 43 | + AppleLanguages: "(en)" |
| 44 | +- extendedWaitUntil: |
| 45 | + visible: |
| 46 | + id: product-${PRODUCT_INDEX}-add-to-cart-button |
| 47 | + timeout: 60000 |
| 48 | +- scrollUntilVisible: |
| 49 | + element: |
| 50 | + id: product-${PRODUCT_INDEX}-add-to-cart-button |
| 51 | + direction: DOWN |
| 52 | + timeout: 5000 |
| 53 | + centerElement: true |
| 54 | +- tapOn: |
| 55 | + id: product-${PRODUCT_INDEX}-add-to-cart-button |
| 56 | + enabled: true |
| 57 | +- waitForAnimationToEnd: |
| 58 | + timeout: 3000 |
| 59 | +- runFlow: |
| 60 | + when: |
| 61 | + visible: |
| 62 | + id: header-cart-icon |
| 63 | + commands: |
| 64 | + - tapOn: |
| 65 | + id: header-cart-icon |
| 66 | +- runFlow: |
| 67 | + when: |
| 68 | + notVisible: |
| 69 | + id: checkout-button |
| 70 | + commands: |
| 71 | + - tapOn: |
| 72 | + id: cart-tab |
| 73 | +- extendedWaitUntil: |
| 74 | + visible: |
| 75 | + id: checkout-button |
| 76 | + timeout: 15000 |
| 77 | +- tapOn: |
| 78 | + id: checkout-button |
| 79 | + enabled: true |
| 80 | + |
| 81 | +# Contact |
| 82 | +- extendedWaitUntil: |
| 83 | + visible: |
| 84 | + text: "^Email( or mobile phone number)?$" |
| 85 | + timeout: 60000 |
| 86 | +- tapOn: |
| 87 | + text: "^Email( or mobile phone number)?$" |
| 88 | +- inputText: "${EMAIL}" |
| 89 | +- tapOn: "selected" |
| 90 | +- tapOn: |
| 91 | + text: "^First name( \\(optional\\))?$" |
| 92 | +- inputText: "${FIRST_NAME}" |
| 93 | +- tapOn: "selected" |
| 94 | +- tapOn: |
| 95 | + text: "^Last name$" |
| 96 | +- inputText: "${LAST_NAME}" |
| 97 | +- tapOn: "selected" |
| 98 | + |
| 99 | +# Shipping address |
| 100 | +- scrollUntilVisible: |
| 101 | + element: |
| 102 | + text: "Country/Region" |
| 103 | + direction: DOWN |
| 104 | + timeout: 5000 |
| 105 | +- tapOn: |
| 106 | + text: "Country/Region" |
| 107 | + index: 1 |
| 108 | +- waitForAnimationToEnd: |
| 109 | + timeout: 3000 |
| 110 | +- scrollUntilVisible: |
| 111 | + element: |
| 112 | + text: "^${COUNTRY_LABEL}$" |
| 113 | + direction: UP |
| 114 | + timeout: 5000 |
| 115 | + visibilityPercentage: 10 |
| 116 | + optional: true |
| 117 | +- scrollUntilVisible: |
| 118 | + element: |
| 119 | + text: "^${COUNTRY_LABEL}$" |
| 120 | + direction: DOWN |
| 121 | + timeout: 5000 |
| 122 | + visibilityPercentage: 10 |
| 123 | + optional: true |
| 124 | +- tapOn: |
| 125 | + text: "^${COUNTRY_LABEL}$" |
| 126 | +- waitForAnimationToEnd: |
| 127 | + timeout: 3000 |
| 128 | + |
| 129 | +- scrollUntilVisible: |
| 130 | + element: |
| 131 | + text: "Address" |
| 132 | + direction: DOWN |
| 133 | + timeout: 5000 |
| 134 | +- tapOn: |
| 135 | + text: "Address" |
| 136 | + index: -1 |
| 137 | +- eraseText: 80 |
| 138 | +- inputText: "${ADDRESS_LINE1}" |
| 139 | +- tapOn: "selected" |
| 140 | +- scrollUntilVisible: |
| 141 | + element: |
| 142 | + text: "^City$" |
| 143 | + direction: DOWN |
| 144 | + timeout: 5000 |
| 145 | + centerElement: true |
| 146 | +- tapOn: |
| 147 | + text: "^City$" |
| 148 | + index: -1 |
| 149 | +- eraseText: 80 |
| 150 | +- inputText: "${CITY}" |
| 151 | +- tapOn: "selected" |
| 152 | +- scrollUntilVisible: |
| 153 | + element: |
| 154 | + text: "^${STATE_FIELD_LABEL}$" |
| 155 | + direction: DOWN |
| 156 | + timeout: 5000 |
| 157 | + centerElement: true |
| 158 | +- tapOn: |
| 159 | + text: "^${STATE_FIELD_LABEL}$" |
| 160 | + index: -1 |
| 161 | +- waitForAnimationToEnd: |
| 162 | + timeout: 3000 |
| 163 | +- scrollUntilVisible: |
| 164 | + element: |
| 165 | + text: "^${STATE_LABEL}$" |
| 166 | + direction: UP |
| 167 | + timeout: 5000 |
| 168 | + visibilityPercentage: 100 |
| 169 | + optional: true |
| 170 | +- scrollUntilVisible: |
| 171 | + element: |
| 172 | + text: "^${STATE_LABEL}$" |
| 173 | + direction: DOWN |
| 174 | + timeout: 5000 |
| 175 | + visibilityPercentage: 100 |
| 176 | + optional: true |
| 177 | +- tapOn: |
| 178 | + text: "^${STATE_LABEL}$" |
| 179 | +- waitForAnimationToEnd: |
| 180 | + timeout: 3000 |
| 181 | +- extendedWaitUntil: |
| 182 | + notVisible: "Select a state" |
| 183 | + timeout: 5000 |
| 184 | +- extendedWaitUntil: |
| 185 | + visible: "^${STATE_LABEL}$" |
| 186 | + timeout: 5000 |
| 187 | +- scrollUntilVisible: |
| 188 | + element: |
| 189 | + text: "^${POSTAL_FIELD_LABEL}$" |
| 190 | + direction: DOWN |
| 191 | + timeout: 5000 |
| 192 | + centerElement: true |
| 193 | +- tapOn: |
| 194 | + text: "^${POSTAL_FIELD_LABEL}$" |
| 195 | + index: -1 |
| 196 | +- eraseText: 80 |
| 197 | +- inputText: "${POSTAL_CODE}" |
| 198 | +- tapOn: "selected" |
| 199 | +- extendedWaitUntil: |
| 200 | + visible: "^${POSTAL_CODE}$" |
| 201 | + timeout: 5000 |
| 202 | +- waitForAnimationToEnd: |
| 203 | + timeout: 3000 |
| 204 | + |
| 205 | +# Payment |
| 206 | +- scrollUntilVisible: |
| 207 | + element: |
| 208 | + text: "^Field container for: Card number$" |
| 209 | + direction: DOWN |
| 210 | + timeout: 5000 |
| 211 | + centerElement: true |
| 212 | + optional: true |
| 213 | +- runFlow: |
| 214 | + when: |
| 215 | + visible: "^Field container for: Card number$" |
| 216 | + commands: |
| 217 | + - tapOn: |
| 218 | + text: "^Field container for: Card number$" |
| 219 | + - inputText: "${CARD_NUMBER}" |
| 220 | + - tapOn: "selected" |
| 221 | + - tapOn: "Expiration date (MM / YY)" |
| 222 | + - inputText: "${CARD_EXPIRY}" |
| 223 | + - tapOn: "selected" |
| 224 | + - tapOn: "Field container for: Security code" |
| 225 | + - inputText: "${CARD_SECURITY_CODE}" |
| 226 | + - tapOn: "selected" |
| 227 | + - scrollUntilVisible: |
| 228 | + element: |
| 229 | + text: "^Field container for: Name on card$" |
| 230 | + direction: DOWN |
| 231 | + timeout: 5000 |
| 232 | + centerElement: true |
| 233 | +- scrollUntilVisible: |
| 234 | + element: |
| 235 | + text: "^(Pay now|Complete order)$" |
| 236 | + direction: DOWN |
| 237 | + timeout: 5000 |
| 238 | + centerElement: true |
| 239 | +- tapOn: |
| 240 | + text: "^(Pay now|Complete order)$" |
| 241 | + enabled: true |
| 242 | +- extendedWaitUntil: |
| 243 | + visible: "${POST_SUBMIT_RESULT_PATTERN}" |
| 244 | + timeout: 60000 |
| 245 | +- tapOn: "close" |
| 246 | +- extendedWaitUntil: |
| 247 | + visible: "^Your cart is empty\\.$" |
| 248 | + timeout: 15000 |
0 commit comments