StrikekitStrikekit

E-commerce checkout flow

Browse, cart, nested cards, payment iframe, totals, and confirmation

Hypothetical shop: find a product, add to cart, pay inside an iframe, assert totals. Adapt labels to your storefront.

# checkout-flow.stk — full purchase path (hypothetical)
Platform: web

Group: Store Checkout

    Scenario: Browse products and add Laptop to cart @smoke @checkout
        Given I navigate to "$BASE_URL/products"
        And I wait for "products"
        When I fill "search" with "Laptop"
        And I press "Enter" on "search"
        And I wait for see "Laptop Pro"
        When I in "products"
        And I in "Laptop Pro"
        And I fill "quantity" with "2"
        And I click on "Add to cart"
        When I in "page"
        Then I should see "Added to cart"
        And I should see containing "Laptop Pro"
        When I hover on "Cart"
        Then I should see "2 items"
        When I click on "Cart"
        And I wait until be on "/cart"
        Then I should be on "/cart"
        And I should in "Cart summary" see "Laptop Pro"
        And I should have "cart-lines" count be greater than "0"

    Scenario: Checkout with coupon and payment iframe @checkout
        Given I navigate to "$BASE_URL/cart"
        And I wait for "Checkout"
        When I click on "Checkout"
        And I wait until be on "/checkout"
        When I generate "@coupon" as string length "8" charset "hex"
        And I fill "coupon-code" with "@coupon"
        And I click on "Apply coupon"
        And I wait until not see "Applying..."
        Then I should see containing "Discount"
        When I store "@subtotal" from "subtotal"
        And I store "@tax" from "tax"
        And I calculate "@estimate" as "@subtotal+@tax"
        Then I should have "order-total" be at least "1"
        When I scope to "Payment frame"
        And I fill "card-number" with "4111111111111111"
        And I fill "expiry" with "12/28"
        And I fill "cvc" with "123"
        And I fill "name-on-card" with "{{name}}"
        And I click on "Pay now"
        When I scope to "page"
        And I wait for see "Order confirmed"
        Then I should see "Order confirmed"
        And I should not see "Payment failed"
        And I should be on "/orders/"
        When I store "@@last-order" from "order-number"
        Then I should see "@@last-order"

    Scenario: Revisit last order from group slot @checkout
        Given I navigate to "$BASE_URL/orders"
        And I wait for "orders"
        When I click on "View" in row "@@last-order"
        And I wait for see "Order details"
        Then I should in "Order details" see "@@last-order"
        And I should in "Order details" see "Laptop Pro"
        And I should have "order-status" be visible

Commands used

navigate, wait, fill, press, in, click, hover, should, generate, store, calculate, scope, in row

On this page