🧪 QA Test Coverage Report · ShopQA v1.0

Test Cases Coverage

Complete list of automated test cases across Playwright E2E, Jest API, and Selenium Python test suites.

40Playwright
E2E Tests
52API Tests
(Jest)
55Selenium
Python Tests
147Total
Test Cases
Showing 147 tests
🎭
Playwright E2E Tests
Full browser automation · File: tests/playwright/shopqa.spec.ts · Run: npx playwright test
40 tests
Authentication (12 tests)
should display login form with all elements
Verifies email input, password input, login button, forgot password link, register link are all visible
authlogin
PW
should show validation errors for empty form
Clicking login without input shows email and password error messages
authvalidation
PW
should show error for invalid email format
Entering "notanemail" shows "Enter a valid email" error
authvalidation
PW
should show error for wrong credentials
Invalid email/password combination shows "Invalid" error message
authsecurity
PW
should successfully login as customer
john@test.com / Password123! → user menu button appears
authhappy-path
PW
should successfully login as admin and redirect
admin@shopqa.com login redirects to /admin page with dashboard visible
authadmin
PW
should toggle password visibility
Eye icon toggles password input type between password and text
authui
PW
should use quick login buttons
Test credentials panel fills email/password fields on click
authui
PW
should show session expired message
?expired=true URL parameter shows warning banner on login page
authsession
PW
should logout and redirect to home
Clicking Sign Out clears session and shows Login button in navbar
authlogout
PW
should show validation for weak password on register
Entering "weak" as password shows strength indicator as Very Weak
authregistervalidation
PW
should fail if passwords do not match
Different values in password and confirm password fields shows mismatch error
authregistervalidation
PW
Product Catalog (10 tests)
should display product listing page
Product grid is visible with 12 cards (default page size)
productlisting
PW
should filter by category
Clicking Electronics filter updates URL with ?category=electronics and shows filtered products
productfilter
PW
should sort products by price ascending
Selecting price_asc sort option orders products from lowest to highest price
productsort
PW
should search for products
Typing "iPhone" in search bar navigates to ?search=iPhone and shows results
productsearch
PW
should show no results for invalid search
Searching "xyznonexistent123" shows empty state with "No products found" message
productedge
PW
should paginate products
Clicking Next page navigates to page=2 and shows different products
productpagination
PW
should switch to grid and list view
Grid/list view toggle buttons add/remove list-view class from product grid
productui
PW
should enable infinite scroll
Toggling infinite scroll checkbox and scrolling to bottom loads more products
productinfinite-scroll
PW
should display full product details
Product detail page shows name, price, stock, star rating, description tabs
productdetail
PW
should show out-of-stock badge
Products with stock=0 show "Out of Stock" overlay badge on product card image
productedge
PW
Shopping Cart (7 tests)
should add product to cart shows count
Clicking Add to Cart increments cart badge count and shows toast notification
cartadd
PW
should update quantity in cart
Clicking + quantity button increments item count in cart page
cartquantity
PW
should remove item from cart
Clicking remove button decrements total item count in cart
cartremove
PW
should apply valid coupon WELCOME10
Entering WELCOME10 shows coupon success message and discount amount
cartcoupon
PW
should reject invalid coupon
Entering INVALIDCODE999 shows coupon error message
cartcouponedge
PW
should reject expired coupon EXPIRED50
Applying expired coupon shows "expired" or "invalid" error message
cartcouponedge
PW
should show correct total with coupon
After applying WELCOME10, cart total updates and discount is reflected
cartcouponcalculation
PW
Checkout (11 tests)
should show step indicator with 4 steps
Checkout page shows 4-step indicator: Shipping, Delivery, Payment, Review
checkoutui
PW
should validate required shipping fields
Clicking Continue without filling shipping form shows validation toast
checkoutvalidation
PW
should validate postal code format
Entering "123" (only 3 digits) shows invalid postal code error
checkoutvalidation
PW
should navigate through all 4 checkout steps
Filling each step and clicking Continue advances through Shipping → Delivery → Payment → Review
checkoutnavigation
PW
should simulate payment failure with declined card
Using card 4000000000000002 shows payment declined error toast
checkoutpaymentedge
PW
should select date from date picker
Opens calendar, navigates months, selects a date, calendar closes
checkoutdate-pickerui
PW
iFrame payment widget should be visible
Credit card section shows an actual iframe element for payment
checkoutiframe
PW
should show all 4 delivery options
Standard, Express, Overnight, and Pickup options are all visible in delivery step
checkoutdelivery
PW
should show all 4 payment methods
Credit Card, UPI, PayPal, COD options are displayed in payment step
checkoutpayment
PW
should navigate back between checkout steps
Back button on delivery step returns to shipping step
checkoutnavigation
PW
order summary should always be visible
Right sidebar with order items and totals is visible on all checkout steps
checkoutui
PW
Admin Panel (8 tests)
should display dashboard stats
Admin dashboard shows Total Revenue, Total Orders, and Total Users stat cards
admindashboard
PW
should deny access to non-admin user
Regular customer trying to access /admin sees "Access Denied" page
adminsecurity
PW
should open add product modal
+ Add Product button opens the product form modal dialog
adminmodal
PW
should validate product form required fields
Submitting empty product form shows "Product name is required" error
adminvalidation
PW
should close modal with Escape key
Pressing ESC keyboard shortcut closes the product form modal
adminmodalkeyboard
PW
should respond to drag events on image dropzone
Drag-over event on dropzone adds drag-over CSS class to the element
admindrag-drop
PW
should create a new coupon
Filling coupon form with code, type, value and saving shows coupon in table
admincoupon
PW
should prevent duplicate coupon codes
Trying to create coupon with existing code WELCOME10 shows error toast
admincouponedge
PW
Accessibility & Misc (4 tests)
should have proper ARIA labels on navigation
Navbar has role="search" and aria-label="Search products" on search input
a11yaria
PW
should be keyboard navigable
Tab key moves focus through interactive elements on login page
a11ykeyboard
PW
should have correct page title
Home page document title contains "ShopQA"
a11yseo
PW
protected routes should redirect to login
Accessing /orders without authentication redirects to /login
authsecurity
PW
🔌
API Tests (Jest + Supertest)
REST API testing · File: tests/api/api.test.js · Run: npm test (from backend/)
52 tests
Authentication API (9 tests)
POST /api/auth/register — should register a new user
Returns 201 with user object and verificationToken in dev mode
auth201
API
POST /api/auth/register — should reject duplicate email
Returns 409 with code EMAIL_TAKEN when email already exists
auth409edge
API
POST /api/auth/register — should reject weak password
Returns 400 with code VALIDATION_ERROR for password less than 8 chars
auth400validation
API
POST /api/auth/login — should login as admin and return tokens
Returns 200 with accessToken, refreshToken and user.role = admin
auth200
API
POST /api/auth/login — should return 401 for wrong password
Returns 401 with code INVALID_CREDENTIALS and attemptsRemaining field
auth401security
API
POST /api/auth/login — should lock account after 5 failed attempts
After 5 wrong passwords, returns 403 with code ACCOUNT_LOCKED
auth403security
API
POST /api/auth/login — should reject unverified email account
Returns 403 with code EMAIL_NOT_VERIFIED for unverified accounts
auth403
API
GET /api/auth/me — should return 401 with no token
Returns 401 with code MISSING_TOKEN when no Authorization header
auth401security
API
GET /api/auth/me — should return 401 with invalid token
Returns 401 when Bearer token is malformed or expired
auth401security
API
Products API (8 tests)
GET /api/products — should return paginated products
Returns products array with total, pages, hasNext, hasPrev fields
productpagination
API
GET /api/products?category=electronics — filter by category
All returned products have category_slug = electronics
productfilter
API
GET /api/products?search=iphone — search products
Returns products where name contains "iphone" (case-insensitive)
productsearch
API
GET /api/products?minPrice=100&maxPrice=1000 — price range
All returned products have price between 100 and 1000
productfilter
API
GET /api/products?sort=price_asc — sort ascending
Products returned in ascending price order (each price >= previous)
productsort
API
GET /api/products?inStock=true — in-stock filter
All returned products have stock > 0
productfilter
API
GET /api/products — page 1 vs page 2 no overlap
Products on page 1 and page 2 have no common product IDs
productpagination
API
GET /api/products/:id — should return 404 for non-existent
Returns 404 with code PRODUCT_NOT_FOUND for unknown UUID
product404edge
API
Cart API (7 tests)
GET /api/cart — should get empty cart
Returns cart object with itemCount >= 0 for authenticated user
cart200
API
GET /api/cart — should require authentication
Returns 401 when no Bearer token is provided
cart401security
API
POST /api/cart/items — should add item to cart
Returns 201 with "Item added to cart" message
cart201
API
POST /api/cart/items — should reject out-of-stock item
Returns 400 with code OUT_OF_STOCK when product.stock = 0
cart400edge
API
POST /api/cart/coupon — should apply valid WELCOME10
Returns coupon object with discount amount calculated
cartcoupon200
API
POST /api/cart/coupon — should reject expired EXPIRED50
Returns 400 with code INVALID_COUPON for expired coupon
cartcoupon400edge
API
POST /api/cart/coupon — should reject invalid code
Returns 400 for completely non-existent coupon code
cartcoupon400
API
Orders API (7 tests)
POST /api/orders — successful payment card 4111...
Returns 201 with order_number matching ORD- pattern and payment_status=paid
orderpayment201
API
POST /api/orders — declined card 4000000000000002
Returns 402 with code PAYMENT_FAILED and paymentError=INSUFFICIENT_FUNDS
orderpayment402edge
API
POST /api/orders — UPI fail@upi triggers failure
Returns 402 with paymentError=UPI_FAILED when upiId is fail@upi
orderpayment402edge
API
POST /api/orders/:id/cancel — cancel confirmed order
Returns 200 and stock is restored to products after cancellation
ordercancel200
API
POST /api/orders/:id/cancel — cannot cancel twice
Returns 400 with code CANNOT_CANCEL for already cancelled order
ordercancel400edge
API
GET /api/orders — should list user orders
Returns array of orders for the authenticated user only
order200
API
GET /api/orders/:id — cannot access other user's order
Returns 404 when trying to access order belonging to different user
order404security
API
Reviews API (5 tests)
GET /api/reviews?productId= — get reviews
Returns reviews array, total, avgRating, and rating distribution
review200
API
GET /api/reviews — should require productId param
Returns 400 when productId query parameter is missing
review400validation
API
POST /api/reviews — should add review with rating and body
Returns 201 with created review object for authenticated user
review201
API
POST /api/reviews — should reject rating > 5
Returns 400 when rating value is 6 or greater
review400validation
API
POST /api/reviews — should prevent duplicate review
Returns 409 with code ALREADY_REVIEWED when user reviews same product twice
review409edge
API
Admin API (5 tests)
GET /api/admin/dashboard — get stats
Returns stats with total_orders, total_users, total_revenue fields
admin200
API
GET /api/admin/users — list all users
Returns array of all users in the system for admin
admin200
API
PATCH /api/admin/users/:id — ban a user
Returns updated user with status=banned, then restores to active
admin200
API
POST /api/admin/coupons — create coupon
Returns 201 with created coupon object
admincoupon201
API
GET /api/admin/dashboard — deny non-admin
Returns 403 when customer token is used to access admin endpoints
admin403security
API
QA Helpers & Edge Cases (11 tests)
GET /api/qa/status — return QA status
Returns status=ok, environment, and database record counts
qa-helper200
API
PATCH /api/qa/products/:id/stock — toggle stock
Sets product stock to specified value, returns updated product
qa-helper200
API
GET /api/qa/status — disabled in production
Returns 403 with code QA_DISABLED when NODE_ENV=production
qa-helper403security
API
POST /api/qa/reset — reset test data
Returns 200 with reset confirmation message and timestamp
qa-helper200
API
GET /api/nonexistent/route — return 404
Returns 404 with code NOT_FOUND for completely unknown routes
edge404
API
POST with malformed JSON — handle gracefully
Returns 400/422/500 without crashing when JSON body is malformed
edgesecurity
API
GET /api/products?search=SQL_INJECTION — safe
SQL injection in search param returns 200 with empty results, doesn't crash
edgesecurity
API
GET /api/products?search=XSS_SCRIPT — safe
<script>alert(1)</script> in search param returns 200 safely
edgesecurity
API
GET /api/products?page=99999 — large page number
Returns 200 with empty products array instead of error
edge200
API
GET /api/products?minPrice=-100 — negative price
Negative price filter returns 200 without throwing server error
edge200
API
POST /api/products — require admin role
Returns 403 FORBIDDEN when customer token tries to create product
security403
API
🐍
Selenium Python Tests
Browser automation · File: tests/selenium/test_shopqa.py · Run: pytest test_shopqa.py -v
55 tests
TestAuthentication (10 tests)
test_login_page_loads
Login form, email input, password input, login button all displayed
auth
SE
test_empty_form_shows_errors
Clicking login with empty form shows email validation error message
authvalidation
SE
test_invalid_credentials_shows_error
Wrong email/password combination shows "Invalid" in error message
authsecurity
SE
test_valid_login_customer
john@test.com / Password123! login shows user menu button in navbar
authhappy-path
SE
test_valid_login_admin
Admin login redirects to /admin URL within 1 second
authadmin
SE
test_password_visibility_toggle
Eye icon cycles password input type between "password" and "text"
authui
SE
test_logout_clears_session
Clicking Sign Out shows Login button in navbar after logout
authlogout
SE
test_session_expired_message
?expired=true in URL shows session expired warning banner
authsession
SE
test_quick_login_fills_form
Expanding test credentials panel and clicking fills form fields
authui
SE
test_register_password_mismatch
Mismatched password/confirm fields shows error message on register page
authregistervalidation
SE
TestProductCatalog (14 tests)
test_products_page_loads
Product grid is visible and contains at least 1 product card
product
SE
test_product_count_displayed
Product count element shows text without "Loading" after page loads
product
SE
test_filter_by_category
Clicking electronics filter updates URL with category=electronics
productfilter
SE
test_sort_by_price_ascending
Selecting price_asc from dropdown ensures first price <= last price
productsort
SE
test_search_products
Typing "iPhone" in search and clicking search button sets search=iPhone in URL
productsearch
SE
test_empty_search_shows_no_results
Searching nonsense string shows empty-state element with no results message
productedge
SE
test_pagination_next_page
Clicking next page button changes URL to page=2 with different first product
productpagination
SE
test_grid_list_view_toggle
List view button adds "list-view" class; grid view button removes it
productui
SE
test_filter_min_max_price
Entering min/max price values updates URL with minPrice and maxPrice params
productfilter
SE
test_product_detail_page
Clicking product card opens detail page with product name visible
productdetail
SE
test_product_detail_has_add_to_cart
Product detail page shows Add to Cart button or Notify button (if OOS)
productdetail
SE
test_product_tabs
Clicking Reviews and Specifications tabs shows corresponding content sections
producttabs
SE
test_product_image_gallery
Main product image is displayed on detail page for iphone-15-pro
productgallery
SE
test_add_to_wishlist
Clicking wishlist heart on product detail changes button to filled state
productwishlist
SE
TestShoppingCart (6 tests)
test_add_to_cart_shows_count
Clicking Add to Cart increments cart badge count by 1
cartadd
SE
test_cart_page_shows_items
Cart page shows item rows or empty cart message when no items
cart
SE
test_apply_valid_coupon
Entering WELCOME10 and clicking Apply shows coupon success message
cartcoupon
SE
test_apply_invalid_coupon
Entering INVALIDCOUPON999 shows coupon error element
cartcouponedge
SE
test_apply_expired_coupon
Entering EXPIRED50 shows error containing "expired" or "invalid" text
cartcouponedge
SE
test_remove_item_from_cart
Clicking remove button decrements total number of remove buttons by 1
cartremove
SE
TestCheckout (11 tests)
test_checkout_shows_step_indicator
Checkout page displays step indicator element with multiple steps
checkoutui
SE
test_shipping_form_validation
Submitting empty shipping form shows toast error message
checkoutvalidation
SE
test_postal_code_validation
Entering 3-digit postal code shows toast error on next click
checkoutvalidation
SE
test_navigate_delivery_step
Filling valid shipping form and clicking Continue shows delivery step
checkoutnavigation
SE
test_delivery_options_visible
Standard, Express, Overnight, Pickup options all visible in delivery step
checkoutdelivery
SE
test_date_picker_opens
Date picker trigger button opens calendar, navigating months works
checkoutdate-picker
SE
test_payment_step_shows_methods
Credit Card, UPI, PayPal, COD payment options all visible
checkoutpayment
SE
test_credit_card_form_appears
Selecting Credit Card radio shows card form with number/expiry/CVV fields
checkoutpayment
SE
test_iframe_payment_visible
Payment section contains visible iframe element with tag_name="iframe"
checkoutiframe
SE
test_back_button_navigates
Back button from delivery step returns to shipping step
checkoutnavigation
SE
test_order_summary_visible
Order summary sidebar is always visible throughout checkout flow
checkoutui
SE
TestAdminPanel (9 tests)
test_admin_dashboard_loads
Admin dashboard shows stats grid with total revenue stat card
admindashboard
SE
test_non_admin_denied
Customer accessing /admin sees "Access Denied" text or is redirected
adminsecurity
SE
test_admin_products_page
Admin products table is visible and has at least 1 product row
adminproducts
SE
test_add_product_modal
+ Add Product button opens product form modal dialog
adminmodal
SE
test_product_form_validation
Submitting empty product form shows product name error element
adminvalidation
SE
test_close_modal_with_escape
Pressing Escape key closes the product form modal
adminmodalkeyboard
SE
test_drag_drop_image_upload
Dispatching dragover event on dropzone adds "drag-over" CSS class
admindrag-dropupload
SE
test_create_coupon
Filling coupon form with random code and saving shows code in coupons table
admincoupon
SE
test_admin_orders_table + test_admin_users_table
Orders and Users tables visible with data rows in admin panel
adminordersusers
SE
TestAccessibilityAndEdgeCases (5 tests)
test_page_title
Home page browser title contains "ShopQA"
a11yseo
SE
test_navigation_keyboard
Tab key focuses an interactive element with a data-testid attribute
a11ykeyboard
SE
test_404_page
Non-existent route shows 404 or "Not Found" text in page source
edge404
SE
test_protected_routes_redirect
Accessing /orders without auth clears cookies and redirects to /login
securityredirect
SE
test_star_rating_interactive
Star rating widget in review form responds to clicks
uireview
SE

🔍

No test cases match your search.