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