QA Testing Plan: Products
This document covers QA test cases for the Products business app located at /business/apps/products. The app supports creating and managing digital and physical products with media uploads, pricing, specifications, and publish/draft lifecycle.
Routes Under Test
Section titled “Routes Under Test”| Route | Purpose |
|---|---|
/business/apps/products | Dashboard with stats and recent products list |
/business/apps/products/new | Create product form (superforms + createProductSchema) |
/business/apps/products/[id] | Product detail with actions: publish, delete, add/remove media, add/remove files, add/remove specs |
Form Actions Reference
Section titled “Form Actions Reference”| Route | Action | Method | Key Fields |
|---|---|---|---|
/business/apps/products/new | default | POST | title, description, short_description, thumbnail_url, price, compare_price, type |
/business/apps/products/[id] | publish | POST | (none) |
/business/apps/products/[id] | delete | POST | (none) |
/business/apps/products/[id] | add-media | POST | url, type (image/video), product_id |
/business/apps/products/[id] | remove-media | POST | media_id |
/business/apps/products/[id] | add-file | POST | title, file_path, product_id |
/business/apps/products/[id] | remove-file | POST | file_id |
/business/apps/products/[id] | add-spec | POST | key, value, product_id |
/business/apps/products/[id] | remove-spec | POST | spec_id |
1. Dashboard and Navigation
Section titled “1. Dashboard and Navigation”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| PROD-001 | Dashboard loads with stats for authenticated user | User is logged in and has products | 1. Navigate to /business/apps/products | Stats cards display: Total Products, Published, Total Sales, Revenue. Recent products list shows up to 5 items. | P0 |
| PROD-002 | Dashboard shows empty state for new user | User is logged in with no products | 1. Navigate to /business/apps/products | Stats section is hidden. Empty state message “No products yet” is displayed. | P1 |
| PROD-003 | Unauthenticated user sees null stats | User is not logged in | 1. Navigate to /business/apps/products | Page loads with stats: null and empty recentProducts array. No crash. | P1 |
| PROD-004 | ”New Product” button navigates correctly | User is logged in | 1. Click “New Product” button | Browser navigates to /business/apps/products/new. | P0 |
| PROD-005 | Recent product links navigate to detail page | User has at least one product | 1. Click a product in the recent products list | Browser navigates to /business/apps/products/{id}. | P1 |
| PROD-006 | Product status badges render correct variants | User has products with draft, published, and inactive statuses | 1. View recent products list | Draft shows “secondary” badge, published shows “default”, inactive shows “destructive”. | P2 |
2. Create Product
Section titled “2. Create Product”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| PROD-010 | Create product with all required fields | User is logged in | 1. Navigate to /business/apps/products/new 2. Fill in title (required) 3. Submit form | Product is created. User is redirected to /business/apps/products/{new_id}. | P0 |
| PROD-011 | Create product with all optional fields | User is logged in | 1. Navigate to /business/apps/products/new 2. Fill title, description, short_description, thumbnail_url, price, compare_price, type | Product is created with all fields persisted. Redirect to detail page. | P0 |
| PROD-012 | Validation: empty title rejected | User is logged in | 1. Navigate to /business/apps/products/new 2. Leave title blank 3. Submit | Form returns 400 with validation error “Title is required”. | P0 |
| PROD-013 | Validation: title exceeds 255 characters | User is logged in | 1. Enter a title with 256+ characters 2. Submit | Form returns 400 with validation error for max length. | P1 |
| PROD-014 | Validation: short_description exceeds 500 characters | User is logged in | 1. Enter short_description with 501+ characters 2. Submit | Form returns 400 with validation error for max length. | P1 |
| PROD-015 | Validation: negative price rejected | User is logged in | 1. Enter price as -5 2. Submit | Form returns 400 with error “Price must be positive”. | P1 |
| PROD-016 | Validation: negative compare_price rejected | User is logged in | 1. Enter compare_price as -1 2. Submit | Form returns 400 with error “Compare price must be positive”. | P1 |
| PROD-017 | Product type defaults correctly | User is logged in | 1. Create product without specifying type | Product is created with the schema default for type (optional/undefined). | P2 |
| PROD-018 | Product type: digital | User is logged in | 1. Select type “digital” 2. Submit | Product is created with type: "digital". | P1 |
| PROD-019 | Product type: physical | User is logged in | 1. Select type “physical” 2. Submit | Product is created with type: "physical". | P1 |
| PROD-020 | Unauthenticated user redirected from create page | User is not logged in | 1. Navigate to /business/apps/products/new | User is redirected to /login. | P0 |
3. Product Detail and Lifecycle
Section titled “3. Product Detail and Lifecycle”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| PROD-030 | Load product detail page | User owns the product | 1. Navigate to /business/apps/products/{id} | Product data loads with details and associated orders. | P0 |
| PROD-031 | 404 for non-existent product | User is logged in | 1. Navigate to /business/apps/products/{invalid_id} | 404 error “Product not found” is returned. | P0 |
| PROD-032 | 403 for product owned by another user | User is logged in but does not own the product | 1. Navigate to /business/apps/products/{other_user_product_id} | 403 Forbidden error is returned. | P0 |
| PROD-033 | Publish a draft product | User owns a draft product | 1. Submit the publish action on the detail page | Action returns { published: true }. Product status updates to “published”. | P0 |
| PROD-034 | Delete a product | User owns a product | 1. Submit the delete action on the detail page | Product is deleted. User is redirected to /business/apps/products. | P0 |
| PROD-035 | Delete action requires authentication | User is not logged in | 1. POST to ?/delete | Returns 401 fail. | P1 |
4. Media Management
Section titled “4. Media Management”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| PROD-040 | Add image media to product | User owns a product | 1. Submit add-media with url, type: "image", product_id | Media is added. Returns { mediaAdded: true }. | P0 |
| PROD-041 | Add video media to product | User owns a product | 1. Submit add-media with url, type: "video", product_id | Media is added. Returns { mediaAdded: true }. | P1 |
| PROD-042 | Add media fails without URL | User owns a product | 1. Submit add-media without url | Returns 400 “Missing URL or product ID”. | P1 |
| PROD-043 | Add media fails without product_id | User owns a product | 1. Submit add-media without product_id | Returns 400 “Missing URL or product ID”. | P1 |
| PROD-044 | Remove media by ID | User owns a product with media | 1. Submit remove-media with media_id | Media is removed. Returns { mediaRemoved: true }. | P0 |
| PROD-045 | Remove media fails without media_id | User is logged in | 1. Submit remove-media without media_id | Returns 400 “Missing media ID”. | P1 |
5. File Management
Section titled “5. File Management”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| PROD-050 | Add file to product | User owns a product | 1. Submit add-file with title, file_path, product_id | File is added. Returns { fileAdded: true }. | P0 |
| PROD-051 | Add file fails with missing fields | User is logged in | 1. Submit add-file without title or file_path or product_id | Returns 400 “Missing required fields”. | P1 |
| PROD-052 | Remove file by ID | User owns a product with files | 1. Submit remove-file with file_id | File is removed. Returns { fileRemoved: true }. | P0 |
| PROD-053 | Remove file fails without file_id | User is logged in | 1. Submit remove-file without file_id | Returns 400 “Missing file ID”. | P1 |
6. Specifications
Section titled “6. Specifications”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| PROD-060 | Add specification to product | User owns a product | 1. Submit add-spec with key, value, product_id | Specification is added. Returns { specAdded: true }. | P0 |
| PROD-061 | Add spec fails with missing fields | User is logged in | 1. Submit add-spec without key or value or product_id | Returns 400 “Missing required fields”. | P1 |
| PROD-062 | Remove specification by ID | User owns a product with specs | 1. Submit remove-spec with spec_id | Specification is removed. Returns { specRemoved: true }. | P0 |
| PROD-063 | Remove spec fails without spec_id | User is logged in | 1. Submit remove-spec without spec_id | Returns 400 “Missing specification ID”. | P1 |