Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/checkout.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
{"fill": {"target": "testid=field_cardCvc", "text": "123"}},
{"fill": {"target": "testid=field_cardName", "text": "Ada Lovelace"}},
{"tap": "testid=continuePayment"},
{"scroll_to": {"target": "testid=sumTax", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=sumTax", "condition": "text", "text": "$5.64", "exact": true}},
{"wait_for": {"target": "testid=sumTotal", "condition": "text", "text": "$69.23", "exact": true}},
{"tap": "testid=placeOrder"},
Expand Down Expand Up @@ -56,6 +57,7 @@
{"fill": {"target": "testid=field_cardCvc", "text": "123"}},
{"fill": {"target": "testid=field_cardName", "text": "Grace Hopper"}},
{"tap": "testid=continuePayment"},
{"scroll_to": {"target": "testid=sumShipping", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=sumShipping", "condition": "text", "text": "$5.99", "exact": true}},
{"wait_for": {"target": "testid=sumTax", "condition": "text", "text": "$5.29", "exact": true}},
{"wait_for": {"target": "testid=sumTotal", "condition": "text", "text": "$84.26", "exact": true}}
Expand All @@ -64,6 +66,7 @@
{"tap": "testid=product_tee"}, {"tap": "testid=size_S"}, {"tap": "testid=addToCart"}, {"tap": "testid=backBtn"},
{"tap": "testid=product_tumbler"}, {"tap": "testid=addToCart"}, {"tap": "testid=backBtn"},
{"tap": "testid=product_tote"}, {"tap": "testid=addToCart"}, {"tap": "testid=viewCart"},
{"scroll_to": {"target": "testid=sumMerch", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=sumMerch", "condition": "text", "text": "$75.00", "exact": true}},
{"tap": "testid=checkoutBtn"},
{"wait_for": {"target": "testid=shipPrice_standard", "condition": "text", "text": "Free", "exact": true}},
Expand Down Expand Up @@ -142,8 +145,11 @@
{"fill": {"target": "testid=field_zip", "text": "123"}},
{"fill": {"target": "testid=field_city", "text": "Portland"}, "description": "a ZIP's number pad has no enter key on iOS"},
{"keyboard": {"key": "enter"}, "description": "the keyboard covers Continue on a long form; enter gives up focus"}, {"tap": "testid=continueBtn"},
{"scroll_to": {"target": "testid=error_name", "direction": "up"}, "description": "on a short screen, a car's, the test scrolled past it, and wait_for does not scroll"},
{"wait_for": {"target": "testid=error_name", "condition": "text", "text": "Enter your name.", "exact": true}},
{"scroll_to": {"target": "testid=error_state", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=error_state", "condition": "text", "text": "Choose a state.", "exact": true}},
{"scroll_to": {"target": "testid=error_zip", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=error_zip", "condition": "text", "text": "Enter a 5-digit ZIP code.", "exact": true}}
]},
{"name": "the declined cards are declined, and nothing is ordered", "steps": [
Expand Down
14 changes: 12 additions & 2 deletions tests/shop.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"tests": [
{"name": "the catalog lists every product", "steps": [
{"wait_for": {"target": "testid=resultCount", "condition": "text", "text": "13 items", "exact": true}},
{"scroll_to": {"target": "testid=price_tee", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=price_tee", "condition": "text", "text": "$24.00", "exact": true}}
]},
{"name": "a price range narrows the catalog", "steps": [
Expand All @@ -35,19 +36,23 @@
{"name": "price, low to high, starts with the magnet", "steps": [
{"tap": "testid=sortMenu"},
{"tap": "testid=sort_price_asc"},
{"wait_for": {"target": "testid=price_magnet", "timeout_ms": 3000}},
{"wait_for": {"target": "testid=price_stickers", "timeout_ms": 3000}},
{"wait_for": {"target": "testid=product_magnet", "timeout_ms": 3000}, "description": "its card, which is in the first row on a car's short screen too, where its price is below the fold; no scroll, or a wrong order would pass"},
{"wait_for": {"target": "testid=product_stickers", "timeout_ms": 3000}},
{"wait_for": {"target": "testid=price_hoodie", "condition": "hidden", "timeout_ms": 3000}}
]},
{"name": "an XXL tee costs $2 more", "steps": [
{"tap": "testid=product_tee"},
{"scroll_to": {"target": "testid=addToCart", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=addToCart", "condition": "disabled"}},
{"tap": "testid=size_XXL"},
{"scroll_to": {"target": "testid=productPrice", "direction": "up"}, "description": "on a short screen, a car's, the test scrolled past it, and wait_for does not scroll"},
{"wait_for": {"target": "testid=productPrice", "condition": "text", "text": "$26.00", "exact": true}},
{"scroll_to": {"target": "testid=addToCart", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=addToCart", "condition": "enabled"}}
]},
{"name": "out of stock cannot be added", "steps": [
{"tap": "testid=product_beanie"},
{"scroll_to": {"target": "testid=productStock", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": "testid=productStock"},
{"wait_for": {"target": "testid=addToCart", "condition": "disabled", "timeout_ms": 2000}},
{"tap": "testid=backBtn"},
Expand Down Expand Up @@ -76,11 +81,13 @@
{"tap": "testid=product_mug"},
{"tap": "testid=addToCart"},
{"tap": "testid=viewCart"},
{"scroll_to": {"target": "testid=sumMerch", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=sumMerch", "condition": "text", "text": "$64.00", "exact": true}},
{"fill": {"target": "testid=codeField", "text": "welcome10"}},
{"tap": "testid=applyCode"},
{"wait_for": {"target": "testid=codeMessage", "condition": "text", "text": "WELCOME10 applied: 10% off merchandise.", "exact": true}},
{"wait_for": {"target": "testid=sumDiscount", "condition": "text", "text": "-$6.40", "exact": true}},
{"scroll_to": {"target": "testid=sumTotal", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=sumTotal", "condition": "text", "text": "$57.60", "exact": true}}
]},
{"name": "a code applies once", "steps": [
Expand Down Expand Up @@ -116,6 +123,7 @@
{"tap": "testid=product_magnet"},
{"tap": "testid=addToCart"},
{"tap": "testid=viewCart"},
{"scroll_to": {"target": "testid=sumMerch", "direction": "down"}, "description": "a short screen, a car's, puts it below the fold, and wait_for does not scroll"},
{"wait_for": {"target": "testid=sumMerch", "condition": "text", "text": "$31.99", "exact": true}},
{"fill": {"target": "testid=codeField", "text": "MOBIUM5"}},
{"tap": "testid=applyCode"},
Expand Down Expand Up @@ -150,6 +158,8 @@
{"wait_for": {"target": "testid=sumDiscount", "condition": "text", "text": "-$3.75", "exact": true}}
]},
{"name": "a gift card needs an email, and takes no code", "steps": [
{"scroll_to": {"target": "testid=category_giftcards", "direction": "right"}, "description": "off the chip row's edge on a phone"},
{"tap": "testid=category_giftcards", "description": "the gift card is the catalog's last: on a car's 158-pixel list fifteen scrolls fall short"},
{"tap": "testid=product_giftcard"},
{"tap": "testid=amount_25"},
{"tap": "testid=addToCart"},
Expand Down
Loading