How to Test Wishlists on Web (Complete Guide)
Wishlists are a crucial feature in e-commerce Web applications, allowing users to save items for future purchases. However, wishlists can be prone to errors, affecting user experience and ultimately,
Introduction to Wishlist Testing
Wishlists are a crucial feature in e-commerce Web applications, allowing users to save items for future purchases. However, wishlists can be prone to errors, affecting user experience and ultimately, sales. Common failures include items disappearing from the wishlist, incorrect pricing, or inability to add/remove items.
What to Test
The following test cases cover various scenarios to ensure a robust wishlist feature:
- Happy Path Scenarios:
+ Add an item to the wishlist
+ Remove an item from the wishlist
+ View wishlist contents
+ Add multiple items to the wishlist
- Error Scenarios:
+ Attempt to add a non-existent item to the wishlist
+ Attempt to remove an item not in the wishlist
+ Try to view an empty wishlist
- Edge Cases:
+ Add an item to the wishlist with insufficient stock
+ Add an item to the wishlist with a promotion or discount
+ Wishlist item quantity exceeds available stock
- Accessibility Considerations:
+ Screen reader compatibility for wishlist items and actions
+ High contrast mode compatibility for wishlist display
+ Keyboard navigation support for wishlist management
Manual Testing Approach
To manually test the wishlist feature:
- Setup: Ensure you have a test account and a Web application with a wishlist feature.
- Add Item to Wishlist:
- Navigate to an item's product page.
- Click the "Add to Wishlist" button.
- Verify the item is added to the wishlist.
- Remove Item from Wishlist:
- Navigate to the wishlist page.
- Click the "Remove" button next to an item.
- Verify the item is removed from the wishlist.
- View Wishlist Contents:
- Navigate to the wishlist page.
- Verify all added items are displayed.
- Error Scenarios:
- Attempt to add a non-existent item to the wishlist and verify an error message is displayed.
- Attempt to remove an item not in the wishlist and verify an error message is displayed.
Automated Testing Approach
To automate wishlist testing, you can use tools like Playwright or Selenium. Here's an example using Playwright:
// Import required modules
const { test, expect } = require('@playwright/test');
// Test adding an item to the wishlist
test('Add item to wishlist', async ({ page }) => {
// Navigate to the product page
await page.goto('https://example.com/product');
// Click the "Add to Wishlist" button
await page.click('text="Add to Wishlist"');
// Verify the item is added to the wishlist
await expect(page.locator('text="Wishlist (1)"')).toBeVisible();
});
// Test removing an item from the wishlist
test('Remove item from wishlist', async ({ page }) => {
// Navigate to the wishlist page
await page.goto('https://example.com/wishlist');
// Click the "Remove" button next to an item
await page.click('text="Remove"');
// Verify the item is removed from the wishlist
await expect(page.locator('text="Wishlist (0)"')).toBeVisible();
});
You can also use CI/CD tools like GitHub Actions to run automated tests. For example:
name: Wishlist Testing
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
How SUSA Tests Wishlists Autonomously
SUSA, an autonomous QA platform, can test wishlists using various personas, including:
- Curious Persona: Tests adding and removing items from the wishlist.
- Impatient Persona: Tests wishlist loading times and error handling.
- Elderly Persona: Tests accessibility features, such as screen reader compatibility.
- Adversarial Persona: Tests error scenarios, such as attempting to add a non-existent item to the wishlist.
SUSA's autonomous testing can help identify issues like:
| Issue | Description |
|---|---|
| Crashes | Wishlist feature crashes when adding or removing items. |
| ANR | Wishlist feature becomes unresponsive when loading. |
| Dead Buttons | "Add to Wishlist" or "Remove" buttons are non-functional. |
| Accessibility Violations | Wishlist feature does not support screen readers or high contrast mode. |
| Security Issues | Wishlist feature is vulnerable to cross-site scripting (XSS) attacks. |
SUSA's testing can also provide coverage analytics, such as per-screen element coverage and untapped element lists, to help identify areas for improvement. By integrating SUSA with your CI/CD pipeline using tools like GitHub Actions or JUnit XML, you can ensure continuous testing and improvement of your wishlist feature.
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