How to Test Promo Codes on Web (Complete Guide)

Testing promo code functionality on web applications is critical. Bugs here directly impact revenue, customer satisfaction, and brand perception. A broken promo code system can lead to lost sales, fru

March 27, 2026 · 5 min read · How-To Guides

Testing promo code functionality on web applications is critical. Bugs here directly impact revenue, customer satisfaction, and brand perception. A broken promo code system can lead to lost sales, frustrated users abandoning carts, and a perception of an unreliable platform. Common failures include codes not applying, applying incorrectly, applying to the wrong items, or security vulnerabilities allowing unauthorized discounts.

Comprehensive Promo Code Test Cases

Effective testing requires covering various scenarios. Here's a breakdown of essential test cases:

#### Happy Path Scenarios

  1. Valid Code, Single Item: Apply a known valid promo code to a single eligible item in the cart. Verify the discount is applied correctly to the item's price and the total.
  2. Valid Code, Multiple Items: Apply a valid promo code to a cart containing multiple eligible items. Ensure the discount applies as specified (e.g., percentage off total, fixed amount off specific items).
  3. Code with Minimum Purchase: Apply a valid code that requires a minimum purchase value. Verify the discount is only applied when the cart subtotal meets or exceeds the minimum.
  4. Code with Specific Product/Category: Apply a valid code that is restricted to certain products or categories. Confirm the discount applies only to eligible items and not others.
  5. First-Time User Code: Test a promo code intended exclusively for new users. Verify it applies correctly for a new account and is rejected for existing accounts.

#### Error Scenarios

  1. Invalid/Non-existent Code: Enter a code that does not exist or has expired. Verify an appropriate error message is displayed (e.g., "Invalid promo code," "Code not found").
  2. Expired Code: Attempt to apply a promo code that has passed its expiry date. Confirm an "Expired code" or similar message appears.
  3. Code Already Used: For single-use codes, attempt to apply it again after it has been successfully used. Ensure it's rejected with a "Code already redeemed" message.
  4. Code Not Meeting Conditions: Apply a valid code but fail to meet its specific requirements (e.g., minimum purchase, specific items). Verify the discount is not applied and an informative error message is shown.

#### Edge Cases

  1. Case Sensitivity: Test if the promo code is case-sensitive. Apply the same code in different casings (e.g., SUMMER20, summer20, Summer20).
  2. Whitespace: Enter codes with leading/trailing whitespace. Verify the system correctly trims whitespace and applies the code, or rejects it if invalid.
  3. Special Characters: Test codes containing special characters (if supported) and ensure they are handled correctly.
  4. Simultaneous Code Application: If the system allows multiple codes, test applying two valid codes that might conflict or stack in unintended ways.

#### Accessibility Considerations for Promo Codes

  1. Screen Reader Compatibility: Ensure that promo code input fields, error messages, and applied discounts are clearly announced by screen readers. Verify ARIA attributes are correctly implemented.
  2. Keyboard Navigation: Confirm that users can tab to the promo code input field, apply the code, and see the results using only a keyboard.
  3. Visual Clarity: Ensure discount information and error messages are visually distinct and easy to read for users with low vision or color blindness.

Manual Testing Approach

A structured manual approach ensures thoroughness:

  1. Setup: Prepare test accounts (new, existing, potentially with specific user attributes like "elderly" or "accessibility-focused"). Stock the cart with various items, including those that qualify and don't qualify for specific promotions.
  2. Execute Happy Path: Systematically work through test cases 1-5, meticulously verifying discount application, price calculations, and total cart value after each valid code.
  3. Execute Error Scenarios: Proceed to test cases 6-9. Carefully note the exact error messages displayed and compare them against expected user-friendly feedback.
  4. Explore Edge Cases: Implement test cases 10-13, paying close attention to system behavior with variations in code input.
  5. Accessibility Review: Conduct test cases 14-16. Use a screen reader (like NVDA or VoiceOver) and navigate solely with the keyboard. Document any issues related to announced content, focus order, or visual cues.
  6. Cross-Browser/Device Check: Repeat key scenarios across different browsers (Chrome, Firefox, Safari, Edge) and devices (desktop, tablet, mobile) to catch platform-specific bugs.

Automated Testing Approach for Web

Automating promo code testing significantly boosts efficiency and repeatability.


    // Example using Playwright (TypeScript)
    import { test, expect } from '@playwright/test';

    test.describe('Promo Code Functionality', () => {
      test('should apply a valid promo code', async ({ page }) => {
        await page.goto('your-app-url/cart');

        // Add items to cart (assume this part is handled)
        await page.getByText('Add to Cart').first().click(); // Example

        const promoCodeInput = page.locator('input[name="promoCode"]');
        await promoCodeInput.fill('VALIDCODE10');
        await page.getByRole('button', { name: 'Apply Promo' }).click();

        // Assert discount is applied and total is updated
        const discountApplied = page.locator('.discount-amount'); // Adjust selector
        await expect(discountApplied).toContainText('-$10.00'); // Example

        const totalAmount = page.locator('.cart-total'); // Adjust selector
        await expect(totalAmount).toContainText('$90.00'); // Example (assuming original total was $100)
      });

      test('should show error for invalid promo code', async ({ page }) => {
        await page.goto('your-app-url/cart');
        await page.getByText('Add to Cart').first().click();

        const promoCodeInput = page.locator('input[name="promoCode"]');
        await promoCodeInput.fill('INVALIDCODE');
        await page.getByRole('button', { name: 'Apply Promo' }).click();

        const errorMessage = page.locator('.promo-error-message'); // Adjust selector
        await expect(errorMessage).toBeVisible();
        await expect(errorMessage).toContainText('Invalid promo code'); // Example
      });
    });

How SUSA Tests Promo Codes Autonomously

SUSA automates promo code testing by intelligently exploring your web application without requiring pre-written scripts. It leverages its diverse set of user personas to uncover issues that manual or scripted approaches might miss.

SUSA's autonomous exploration identifies:

Furthermore, SUSA's cross-session learning means that each run it performs makes it smarter about your application's unique behavior, leading to more targeted and effective testing of promo code logic over time. It tracks key user flows like "checkout" and provides clear PASS/FAIL verdicts on the promo code application within that flow. SUSA also provides coverage analytics, showing which elements within the promo code interface were interacted with, and identifying untapped elements for further investigation.

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free