{
  "schema_version": 1,
  "name": "Add to cart and check out",
  "version": 1,
  "description": "Open a product page, add it to the cart, go to checkout and fill the shipping form, then stop just before payment for you to review. Bind any payment or personal details to variables or a data source — never hard-code them. This template stops before submitting payment on purpose.",
  "vars": {
    "product_url": "https://example.com/product/123",
    "add_button": "Add to cart",
    "checkout_button": "Checkout",
    "full_name": "REPLACE_WITH_NAME",
    "address": "REPLACE_WITH_ADDRESS",
    "city": "REPLACE_WITH_CITY",
    "zip_code": "REPLACE_WITH_ZIP"
  },
  "on_error": "screenshot_and_stop",
  "steps": [
    { "open": {} },
    { "goto": { "url": "{{product_url}}" } },
    { "wait_for": { "text": "{{add_button}}", "timeout": 15 } },
    { "click": { "text": "{{add_button}}" } },
    { "wait_for": { "text": "{{checkout_button}}", "timeout": 15 } },
    { "click": { "text": "{{checkout_button}}" } },
    { "wait_for": { "text": "Shipping", "timeout": 15 } },
    { "type": { "into": "Full name", "text": "{{full_name}}" } },
    { "type": { "into": "Address", "text": "{{address}}" } },
    { "type": { "into": "City", "text": "{{city}}" } },
    { "type": { "into": "ZIP", "text": "{{zip_code}}" } },
    { "screenshot": { "path": "before-payment.png" } },
    { "stop": { "reason": "stopped before payment — review, then continue by hand or extend the flow" } },
    { "close": {} }
  ]
}
