QA for Ecommerce Platforms
Test ecommerce-specific features - checkout flows, payment processing, inventory sync, and order management.
0 of 5 concepts completed (0%)
What You'll Learn
Tutorial Contents
1.Checkout & Payment Testing
Full checkout test matrix: ``` Happy path flows to test: 1. Guest checkout (no account required) 2. Registered user checkout (saved address) 3. New shipping address + save for future 4. Apply valid coupon code before checkout 5. Multi-item cart with different SKUs 6. Digital product (no shipping required)
Payment method tests: Credit card (Stripe test cards): ✅ 4242 4242 4242 4242 Success ❌ 4000 0000 0000 0002 Card declined 🔒 4000 0027 6000 3184 Requires 3D Secure authentication ⚠️ 4000 0000 0000 9995 Insufficient funds
Negative checkout scenarios: - Apply expired coupon → clear error message, not applied - Submit with empty cart → redirect to cart page - Session timeout during checkout → graceful recovery - Network error on payment → no double-charge, clear message - Duplicate order submission (double-click) → single order created ```
// Cypress: payment test
describe("Checkout Payment", () => {
beforeEach(() => {
cy.visit("/products/widget-pro");
cy.get("[data-cy='add-to-cart']").click();
cy.visit("/checkout");
cy.fillShippingForm(); // custom commandit("completes purchase with valid test card", () => { // Stripe iframe requires switching to frame cy.getStripeElement("cardNumber").type("4242424242424242"); cy.getStripeElement("cardExpiry").type("1230"); cy.getStripeElement("cardCvc").type("123");
cy.get("[data-cy='place-order']").click();
cy.url().should("include", "/order-confirmation"); cy.get("[data-cy='order-number']").should("be.visible"); cy.get("[data-cy='order-total']").should("contain", "$99.99"); });
it("shows error for declined card", () => { cy.getStripeElement("cardNumber").type("4000000000000002"); cy.getStripeElement("cardExpiry").type("1230"); cy.getStripeElement("cardCvc").type("123"); cy.get("[data-cy='place-order']").click();
cy.get("[data-cy='payment-error']") .should("be.visible") .and("contain", "card was declined"); cy.url().should("include", "/checkout"); // stays on checkout }); }); ```
2.Inventory & Order Management
Inventory edge case tests: ``` TC-INV-001: Last item in stock Setup: Product with stock_count = 1 Steps: 1. Add product to cart 2. Verify "Only 1 left" badge shown 3. Complete purchase 4. Verify stock = 0 after order 5. Verify product shows "Out of Stock" on listing page
TC-INV-002: Race condition concurrent purchases Setup: Product with stock_count = 1 Steps: 1. User A and User B both add to cart simultaneously 2. Both proceed to checkout 3. User A completes checkout first Expected: - User A: Order confirmed, inventory decremented - User B: "Item no longer available" error before payment - Inventory never goes below 0
TC-INV-003: Quantity exceeds stock Setup: Product with stock_count = 3 Steps: 1. Add 3 items to cart 2. Another user buys 2 (inventory drops to 1) 3. Attempt to checkout with 3 Expected: Cart quantity automatically adjusted or clear error message ```
Post-order verification checklist: ``` Order confirmation: ☐ Unique order number generated ☐ Order details correct (items, quantities, prices) ☐ Tax calculated correctly ☐ Shipping cost applied correctly ☐ Discount reflected correctly ☐ Total = subtotal + tax + shipping - discount
Email notifications: ☐ Confirmation email received within 2 minutes ☐ Email contains order number, items, total, delivery estimate ☐ Tracking number included when shipped ☐ Return instructions included
Inventory: ☐ Stock count decremented ☐ "Out of Stock" shown when quantity = 0 ☐ Re-order notification triggered at threshold ```
Code Example
// Ecommerce QA test suite
describe('Ecommerce Checkout Flow', () => {
describe('Product Page', () => {
test('Product details are accurate', () => {
cy.visit('/products/widget-pro');
cy.get('[data-testid="product-price"]').should('contain', '$99.99');
cy.get('[data-testid="product-sku"]').should('contain', 'WG-001');
cy.get('[data-testid="inventory"]').should('contain', 'In Stock');
});
test('Add to cart updates cart count', () => {
cy.get('[data-testid="add-to-cart"]').click();
cy.get('[data-testid="cart-count"]').should('contain', '1');
});
});
describe('Cart & Checkout', () => {
test('Cart totals calculate correctly with tax', () => {
// Subtotal: $99.99, Tax (8%): $8.00, Total: $107.99
cy.get('[data-testid="subtotal"]').should('contain', '$99.99');
cy.get('[data-testid="tax"]').should('contain', '$8.00');
cy.get('[data-testid="total"]').should('contain', '$107.99');
});
test('Coupon code applies discount', () => {
cy.get('[data-testid="coupon-input"]').type('SAVE10');
cy.get('[data-testid="apply-coupon"]').click();
cy.get('[data-testid="discount"]').should('contain', '-$10.00');
});
test('Proceed to checkout validates fields', () => {
cy.get('[data-testid="checkout-btn"]').click();
cy.get('input[name="email"]').type('test@example.com');
cy.get('input[name="address"]').type('123 Main St');
// Continue through form...
});
});
describe('Payment Processing', () => {
test('Payment succeeds with valid sandbox card', () => {
// Using Stripe test card: 4242 4242 4242 4242
cy.get('[data-testid="card-number"]').type('4242424242424242');
cy.get('[data-testid="card-expiry"]').type('1225');
cy.get('[data-testid="card-cvc"]').type('123');
cy.get('[data-testid="pay-btn"]').click();
cy.contains('Order confirmed').should('be.visible');
});
test('Payment fails with declined test card', () => {
// Using Stripe declined card: 4000000000000002
cy.get('[data-testid="card-number"]').type('4000000000000002');
cy.get('[data-testid="pay-btn"]').click();
cy.contains('Card declined').should('be.visible');
});
});
describe('Order Confirmation', () => {
test('Order confirmation page shows correct details', () => {
cy.contains('Thank you for your order').should('be.visible');
cy.get('[data-testid="order-number"]').should('be.visible');
cy.get('[data-testid="order-total"]').should('contain', '$107.99');
});
test('Confirmation email sent to customer', () => {
// Check email inbox for order confirmation
cy.checkEmail('test@example.com', 'Order Confirmation');
});
});
});Pro Tips
- 1Always test with Stripe test cards, not real cards. Use 4242 4242 4242 4242 for success, 4000 0000 0000 0002 for decline, 4000 0027 6000 3184 for 3D Secure.
- 2Test inventory edge cases: add the last item in stock, add more than available stock, place concurrent orders for the same last item.
- 3Verify order confirmation emails contain all required information order number, itemized list, billing/shipping address, total, and estimated delivery.
- 4Test promotional codes thoroughly: expired codes, codes used more than their limit, codes combined with other discounts, negative total scenarios.
Topics Covered
Continue Learning
Explore the official documentation and deepen your knowledge with real-world practice.
Explore the Full Portfolio
This is the complete portfolio of Sufi Khan Sulaiman, a technology leader specialising in B2B commerce and digital automation. Start from the Home page for the overview, then move through two decades of career experience across FLIR Systems, Lorex Technology, and 1c Platform, and the full catalogue of project case studies spanning headless commerce migrations, AI recommendation engines, and multi-channel fulfilment systems.
The skills and certifications page maps the technical and leadership capabilities behind the work, while the articles and the knowledge base break down the thinking into actionable frameworks. For hands-on learning, the tutorials and applications sections cover practical builds from front-end fundamentals to full-stack web apps.
For consulting engagement, the expertise page outlines service offerings, the ecommerce hub covers platform architecture and automation strategy, and the ecommerce guide (PDF) is a downloadable 55-page field manual. When you are ready to talk, the contact page is the direct line.