Skip to main content
/tayyab/portfolio — zsh
tayyab
TA
> OPERATION: CartFlow Pro — High-Traffic Flash Sale E-Commerce Platform | STATUS: COMPLETE ✓
UI Automation

CartFlow Pro — High-Traffic Flash Sale E-Commerce Platform

E-commerce platform handling 100K+ concurrent users during flash sales with automated E2E checkout testing across browsers and devices.

Manual and Automation QA Engineer

OVERVIEW

A high-growth e-commerce platform handling extreme traffic during flash sales. My focus was on end-to-end checkout funnel automation, race condition detection in cart operations, payment gateway integration testing, and cross-browser compatibility validation.

TECH STACK

Testing Tools
PlaywrightTypeScriptk6BrowserStackGitHub ActionsAllure
Technologies
TypeScriptPlaywrightStripe Test ModeREST APIsCross-Browser TestingPage Object ModelParallel Execution

THE CHALLENGE

The e-commerce platform experienced catastrophic checkout failures during flash sales when 100K+ concurrent users hit the site simultaneously. Race conditions in cart operations caused double-charges, inventory overselling, and payment failures. No comprehensive E2E automation existed to detect these issues before peak traffic events.

METHODOLOGY

Designed and executed comprehensive end-to-end checkout automation covering the full user journey: product discovery → wishlist → cart operations → checkout → payment processing → order confirmation. Performed cross-browser testing (Chrome, Firefox, Safari, Edge), stress testing with k6 for concurrent checkout operations, and race condition detection tests.

TEST STRATEGY

Implemented Playwright automation using Page Object Model pattern for maintainability across 6 different checkout flows. Created parallel test execution harness supporting 50+ concurrent checkout sessions. Integrated with Stripe test environment for payment gateway validation. Performed race condition testing by launching 100+ simultaneous cart additions to same product. Validated inventory sync accuracy and discount code edge cases.

AUTOMATION PIPELINE

Integrated Playwright tests with GitHub Actions running on every code commit. Created separate CI stages for functional regression (5 min), cross-browser matrix testing on BrowserStack (15 min), and load testing with k6 (10 min). Set up Allure reporting with video/screenshot capture on failures. Automated flaky test detection and retries.

IMPACT METRICS

Flash Sale Checkout Success Rate

59% avg
⟨ Manual Testing (before)

Flash sales experienced checkout failures and race conditions during peak load

⟩ Automated E2E Testing (after)

Comprehensive E2E testing and race condition validation before each sale

// KEY_METRICS

Checkout Success Rate

38%
Manual Testing (before) 68%
Automated E2E Testing (after) 94%

Race Conditions Detected

Manual Testing (before) After launch
Automated E2E Testing (after) Pre-launch

Payment Failures/Hour

97%
Manual Testing (before) 850
Automated E2E Testing (after) 22

Double-Charge Incidents

100%
Manual Testing (before) 12/sale
Automated E2E Testing (after) 0/sale

Cross-Browser Coverage & Consistency

242% avg
⟨ Spot Checks (before)

Manual testing on 2-3 browsers before launch; mobile issues discovered in production

⟩ Automated Matrix Testing (after)

15+ browser versions and 10+ device types tested automatically

// KEY_METRICS

Browsers Tested

400%
Spot Checks (before) 3
Automated Matrix Testing (after) 15+

Mobile Devices Tested

400%
Spot Checks (before) 2
Automated Matrix Testing (after) 10+

UI Rendering Issues

100%
Spot Checks (before) 18 post-launch
Automated Matrix Testing (after) 0 post-launch

Checkout Flow Coverage

67%
Spot Checks (before) 60%
Automated Matrix Testing (after) 100%

E2E Test Execution Time & Parallelization

342% avg
⟨ Sequential Execution (before)

Checkout tests ran sequentially; feedback loop was 60+ minutes

⟩ Parallel Execution (after)

Tests sharded across 12 runners; 50+ concurrent checkout sessions

// KEY_METRICS

Total Test Duration

89%
Sequential Execution (before) 75 min
Parallel Execution (after) 8 min

Parallel Execution

1100%
Sequential Execution (before) None
Parallel Execution (after) 12x

CI Feedback Time

87%
Sequential Execution (before) 90 min
Parallel Execution (after) 12 min

Dev Wait Time/Commit

93%
Sequential Execution (before) 45 min avg
Parallel Execution (after) 3 min avg

CODE SAMPLES

End-to-End Checkout Flow Automation

Complete checkout journey: product selection → cart → payment → confirmation

typescript
TYPESCRIPT_EXECUTION
→ Ready
import { test, expect, Page } from '@playwright/test';

class CheckoutFlow {
  constructor(private page: Page) {}

  async addProductToCart(productId: string, quantity: number = 1) {
    await this.page.goto(`/products/${productId}`);
    await this.page.fill('[data-testid="quantity-input"]', quantity.toString());
    await this.page.click('[data-testid="add-to-cart-btn"]');
    
    // Wait for cart update
    await this.page.waitForLoadState('networkidle');
  }

  async proceedToCheckout() {
    await this.page.goto('/cart');
    await this.page.click('[data-testid="checkout-btn"]');
    
    // Verify checkout page loaded
    await expect(this.page.locator('[data-testid="payment-form"]')).toBeVisible();
  }

  async fillShippingInfo() {
    await this.page.fill('[data-testid="first-name"]', 'John');
    await this.page.fill('[data-testid="last-name"]', 'Doe');
    await this.page.fill('[data-testid="email"]', 'john@example.com');
    await this.page.fill('[data-testid="address"]', '123 Main St');
    await this.page.fill('[data-testid="city"]', 'New York');
    await this.page.fill('[data-testid="zip"]', '10001');
  }

  async fillPaymentInfo() {
    // Use Stripe test card
    const cardFrame = this.page.frameLocator('[data-testid="card-frame"]');
    await cardFrame.locator('[name="cardnumber"]').fill('4242424242424242');
    await cardFrame.locator('[name="exp-date"]').fill('12/25');
    await cardFrame.locator('[name="cvc"]').fill('123');
  }

  async completeCheckout() {
    await this.page.click('[data-testid="place-order-btn"]');
    
    // Wait for order confirmation
    await this.page.waitForURL('/order-confirmation/*');
    const orderId = new URL(this.page.url()).pathname.split('/').pop();
    
    return orderId;
  }
}

test('Complete checkout flow with valid payment', async ({ page }) => {
  const checkout = new CheckoutFlow(page);
  
  await checkout.addProductToCart('PROD-123', 2);
  await checkout.proceedToCheckout();
  await checkout.fillShippingInfo();
  await checkout.fillPaymentInfo();
  
  const orderId = await checkout.completeCheckout();
  
  expect(orderId).toBeTruthy();
  await expect(page.locator('[data-testid="order-total"]')).toContainText('$');
});

Race Condition Test: Concurrent Cart Operations

Detect race conditions by launching 100+ concurrent cart additions

typescript
TYPESCRIPT_EXECUTION
→ Ready
import { test, expect } from '@playwright/test';
import { chromium } from 'playwright';

test('Race condition: 100 concurrent cart additions', async () => {
  const browser = await chromium.launch();
  const productId = 'PROD-LIMITED-STOCK';
  const numConcurrentUsers = 100;
  
  // Create 100 browser contexts simulating concurrent users
  const contexts = await Promise.all(
    Array(numConcurrentUsers).fill(null).map(() => browser.newContext())
  );
  
  // All users add same limited-stock product simultaneously
  const addCartPromises = contexts.map(async (context) => {
    const page = await context.newPage();
    await page.goto(`/products/${productId}`);
    
    const stockBefore = await page.locator('[data-testid="stock-count"]').textContent();
    
    await page.fill('[data-testid="quantity-input"]', '1');
    await page.click('[data-testid="add-to-cart-btn"]');
    
    // Wait for success message or error
    const successMsg = page.locator('[data-testid="item-added"]');
    const stockError = page.locator('[data-testid="out-of-stock"]');
    
    const result = await Promise.race([
      successMsg.waitFor({ state: 'visible' }),
      stockError.waitFor({ state: 'visible' })
    ]).then(() => 'success').catch(() => 'failed');
    
    await context.close();
    return { result, stockBefore };
  });
  
  const results = await Promise.all(addCartPromises);
  
  // Verify no double-sells occurred
  const successCount = results.filter(r => r.result === 'success').length;
  const stockLimit = parseInt(results[0].stockBefore);
  
  expect(successCount).toBeLessThanOrEqual(stockLimit);
  
  // Verify inventory is consistent
  const verifyPage = await browser.newPage();
  await verifyPage.goto(`/products/${productId}`);
  const finalStock = parseInt(await verifyPage.locator('[data-testid="stock-count"]').textContent());
  
  expect(finalStock).toBe(stockLimit - successCount);
  
  await browser.close();
});

MISSION ACCOMPLISHED

Achieved 100% checkout funnel E2E coverage across 6 distinct payment flows. Detected and fixed 23 race conditions before flash sale launch. Cross-browser testing validated consistency across 15+ browser versions. Load testing simulated 100K concurrent users with 99.2% payment success rate. Checkout completion rate improved from 68% to 94% on peak traffic days.

// interested?

READY TO BUILD SOMETHING SIMILAR?

Let's discuss how I can implement test automation for your project.

→ Get in Touch
Available for hire