E-commerce

Stripe Checkout

Complete a purchase using Stripe test credentials

Verified10 steps1 assertionsUpdated Oct 20, 2018
e-commercepaymentstripecheckout

Full hunt definition

e-commerce/stripe-checkout.yml
# Stripe Checkout Flow
# ---
# Pattern: Payment via Stripe embedded checkout
# What it tests: Add item to cart, proceed to checkout, fill Stripe payment form.
# Customize:
#   - Update product and button selectors for your store
#   - Stripe test card: 4242 4242 4242 4242, any future date, any CVC
#   - Add "js.stripe.com" to your .prowl/config.yml allowedDomains
#   - Hunt files live at .prowl/hunts/*.yml
#   - Run artifacts are written to .prowl/runs/<timestamp>/
#
# Note: Stripe's payment form is in an iframe. Prowl's Playwright engine
# handles iframes natively, but you'll need explicit selectors targeting
# the iframe content (e.g., `iframe[name="__privateStripeFrame"]`).
#
# For Stripe Checkout (hosted page), add "checkout.stripe.com" to .prowl/config.yml allowedDomains.

name: stripe-checkout
description: Complete a purchase using Stripe test credentials

tags:
  - e-commerce
  - payment
  - stripe
  - checkout

vars:
  CARD_NUMBER: "4242424242424242"
  CARD_EXPIRY: "12/30"
  CARD_CVC: "123"

steps:
  - navigate: "/products"

  - click: "Add to Cart"
  - click: "Checkout"

  # Wait for Stripe Elements to load
  - waitForNetworkIdle:
      timeout: 10000

  # Fill Stripe payment form inside the secure iframe
  - iframe_action:
      iframeSelector: "iframe[name='__privateStripeFrame']"
      action: "fill"
      targetSelector: "[data-testid='card-number']"
      options:
        text: "{{CARD_NUMBER}}"

  - iframe_action:
      iframeSelector: "iframe[name='__privateStripeFrame']"
      action: "fill"
      targetSelector: "[data-testid='card-expiry']"
      options:
        text: "{{CARD_EXPIRY}}"

  - iframe_action:
      iframeSelector: "iframe[name='__privateStripeFrame']"
      action: "fill"
      targetSelector: "[data-testid='card-cvc']"
      options:
        text: "{{CARD_CVC}}"

  - click: "Pay"

  - waitForNetworkIdle:
      timeout: 15000

  - assert:
      visible: "Payment successful"

assertions:
  - noConsoleErrors: true