How to Test Gift Cards on Web (Complete Guide)

Gift cards are a critical revenue stream and a popular customer engagement tool for e-commerce platforms. Thorough testing ensures a seamless user experience, prevents revenue loss, and maintains cust

May 16, 2026 · 5 min read · How-To Guides

Mastering Web Gift Card Testing: A Practical Guide

Gift cards are a critical revenue stream and a popular customer engagement tool for e-commerce platforms. Thorough testing ensures a seamless user experience, prevents revenue loss, and maintains customer trust. Flaws in gift card functionality can lead to lost sales, frustrated users, and damaged brand reputation.

Common Gift Card Failure Points

Comprehensive Gift Card Test Cases

Here are specific test cases to cover various scenarios:

Happy Path Scenarios:

  1. Full Redemption: Purchase an item exactly equal to the gift card value.
  2. Partial Redemption (Remaining Balance): Purchase an item less than the gift card value. Verify the remaining balance is correctly displayed and can be used later.
  3. Multiple Gift Cards: Apply two or more valid gift cards to a single order.
  4. Gift Card + Other Payment: Apply a gift card and then use another payment method for the remaining balance.
  5. Gift Card as Full Payment: Use a gift card to cover the entire order cost.

Error and Edge Cases:

  1. Invalid Code: Attempt to redeem a non-existent gift card code.
  2. Expired Code: Attempt to redeem an expired gift card code.
  3. Zero Balance Card: Attempt to redeem a gift card with a zero balance.
  4. Case Sensitivity: Test redemption with correct and incorrect casing for the gift card code.
  5. Whitespace in Code: Test redemption with leading/trailing whitespace in the gift card code input.
  6. Special Characters: Test redemption with codes containing special characters (if applicable).
  7. Redemption Limit: If there's a limit on how many times a gift card can be redeemed (e.g., for a specific promotion), test this.

Accessibility Considerations:

  1. Clear Input Fields: Ensure the gift card input field has a clear, descriptive label (e.g., "Gift Card Number," "Promo Code").
  2. Error Message Clarity: Verify that error messages for invalid/expired codes are clear, concise, and accessible to screen readers.
  3. Keyboard Navigation: Confirm users can navigate to and interact with the gift card input and redemption buttons using only a keyboard.
  4. Screen Reader Compatibility: Test that screen readers announce the gift card input field, its purpose, and any error messages correctly.

Manual Testing Approach

Performing manual tests involves meticulous step-by-step execution.

  1. Navigate to Product Page: Select an item to purchase.
  2. Proceed to Cart/Checkout: Add the item to your cart and proceed to the checkout page.
  3. Locate Gift Card Section: Find the designated area for gift card or promo code application.
  4. Input Gift Card Code: Enter a valid gift card code.
  5. Apply Gift Card: Click the "Apply" or equivalent button.
  6. Verify Balance/Discount: Observe the order total to confirm the gift card value has been applied correctly.
  7. Test Different Scenarios: Systematically go through the test cases outlined above, documenting each step and the observed outcome.
  8. Check for Remaining Balance: After partial redemption, navigate to the user account or a dedicated gift card balance checker to confirm the updated balance.
  9. Test Error States: Intentionally enter invalid, expired, or zero-balance codes to verify error handling.
  10. Accessibility Checks: Use a keyboard to navigate the checkout flow. Employ a screen reader (e.g., NVDA, VoiceOver) to verify accessibility.

Automated Testing Approach for Web

Automated testing significantly enhances efficiency and repeatability. For web applications, Playwright is an excellent choice due to its modern API and robust capabilities.

Example Playwright Script Snippet (Node.js):


// Assume 'page' is a Playwright Page object initialized elsewhere
const { test, expect } = require('@playwright/test');

test('redeem a valid gift card', async ({ page }) => {
  await page.goto('https://your-ecommerce-site.com/checkout'); // Navigate to checkout

  const giftCardInputSelector = 'input[name="giftCardCode"]'; // Example selector
  const applyButtonSelector = 'button[data-testid="apply-gift-card"]'; // Example selector
  const orderTotalSelector = '.order-total-amount'; // Example selector

  await page.fill(giftCardInputSelector, 'VALID-GIFT-CARD-123'); // Enter a valid code
  await page.click(applyButtonSelector);

  // Wait for the order total to update and assert the discount
  await page.waitForSelector(orderTotalSelector);
  const initialTotal = parseFloat(await page.textContent(orderTotalSelector)); // Assume this is before GC applied
  const discountedTotal = parseFloat(await page.textContent(orderTotalSelector)); // Assume this is after GC applied

  // This assertion needs to be more sophisticated based on your app's logic
  // For example, check if the total decreased by the gift card amount.
  expect(discountedTotal).toBeLessThan(initialTotal);
});

test('attempt to redeem an invalid gift card', async ({ page }) => {
  await page.goto('https://your-ecommerce-site.com/checkout');

  const giftCardInputSelector = 'input[name="giftCardCode"]';
  const applyButtonSelector = 'button[data-testid="apply-gift-card"]';
  const errorMessageSelector = '.gift-card-error-message'; // Example selector

  await page.fill(giftCardInputSelector, 'INVALID-CODE-XYZ');
  await page.click(applyButtonSelector);

  // Assert that an error message is displayed
  await page.waitForSelector(errorMessageSelector);
  const errorMessage = await page.textContent(errorMessageSelector);
  expect(errorMessage).toContain('Invalid gift card code'); // Or similar expected message
});

Key Playwright Commands:

How SUSA Tests Gift Cards Autonomously

SUSA's autonomous QA platform leverages its diverse user personas and intelligent exploration to uncover gift card issues without manual scripting.

SUSA automatically generates Playwright (for Web) regression test scripts from its exploration. This means after SUSA identifies an issue, you gain an automated script that reliably reproduces the bug, accelerating your debugging and future regression cycles. The platform tracks flow completion (PASS/FAIL) for critical paths like checkout, which inherently includes gift card redemption. Furthermore, SUSA's cross-session learning ensures that as it tests your application repeatedly, it becomes more adept at finding subtle issues, including those related to gift card balance persistence and redemption history. This autonomous, persona-driven approach provides comprehensive coverage for gift card functionality, far beyond what manual testing or basic scripted automation can achieve alone.

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