QA Testing Plan: Workflows
This document covers QA test cases for the Workflows business app located at /business/apps/workflows. The app supports creating workflows with ordered steps and transitions, running workflow instances, performing transitions on instances, and cancelling active workflows.
Routes Under Test
Section titled “Routes Under Test”| Route | Purpose |
|---|---|
/business/apps/workflows | List all workflows with active/inactive badge |
/business/apps/workflows/new | Create workflow form (superforms + createWorkflowSchema) |
/business/apps/workflows/[id] | Workflow detail with step/transition CRUD and delete |
/business/apps/workflows/instances | List all workflow instances |
/business/apps/workflows/instances/[instanceId] | Instance detail with perform-transition and cancel |
Form Actions Reference
Section titled “Form Actions Reference”| Route | Action | Method | Key Fields |
|---|---|---|---|
/business/apps/workflows/new | create | POST | Via createWorkflowSchema |
/business/apps/workflows/[id] | add-step | POST | Via createStepSchema |
/business/apps/workflows/[id] | update-step | POST | step_id, name, order (optional) |
/business/apps/workflows/[id] | delete-step | POST | step_id |
/business/apps/workflows/[id] | add-transition | POST | Via createTransitionSchema |
/business/apps/workflows/[id] | update-transition | POST | transition_id, name, color (optional) |
/business/apps/workflows/[id] | delete-transition | POST | transition_id |
/business/apps/workflows/[id] | delete-workflow | POST | (none) |
/business/apps/workflows/instances/[instanceId] | perform-transition | POST | transition_id, comment (optional) |
/business/apps/workflows/instances/[instanceId] | cancel | POST | (none) |
1. Workflow List
Section titled “1. Workflow List”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| WF-001 | Workflow list loads for authenticated user | User is logged in with workflows | 1. Navigate to /business/apps/workflows | Page shows workflow cards with name, description, active/inactive badge, and date. Count badge in header matches total. | P0 |
| WF-002 | Empty state when no workflows exist | User is logged in with no workflows | 1. Navigate to /business/apps/workflows | Empty state “No workflows created yet.” with CTA “Create your first workflow”. | P1 |
| WF-003 | Unauthenticated user gets empty array | User is not logged in | 1. Navigate to /business/apps/workflows | Page loads with empty workflows array. No crash. | P1 |
| WF-004 | Workflow card links to detail page | User has workflows | 1. Click a workflow card | Navigates to /business/apps/workflows/{id}. | P1 |
| WF-005 | Instances button navigates correctly | User is logged in | 1. Click “Instances” button | Navigates to /business/apps/workflows/instances. | P1 |
| WF-006 | Active/Inactive badge renders correctly | User has both active and inactive workflows | 1. View workflow list | Active workflows show “default” badge, inactive show “secondary”. | P2 |
2. Create Workflow
Section titled “2. Create Workflow”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| WF-010 | Create workflow with valid data | User is logged in | 1. Navigate to /business/apps/workflows/new 2. Fill form per createWorkflowSchema 3. Submit | Workflow is created. User is redirected to /business/apps/workflows/{new_id}. | P0 |
| WF-011 | Validation: invalid form data rejected | User is logged in | 1. Submit with invalid/missing required fields | Form returns 400 with validation errors. | P0 |
| WF-012 | Server error returns message | User is logged in, service throws | 1. Trigger server error during creation | Form returns 500 with error message via superforms. | P1 |
| WF-013 | Unauthenticated create returns 401 | User is not logged in | 1. POST to ?/create | Returns 401 fail. | P0 |
3. Workflow Detail — Steps
Section titled “3. Workflow Detail — Steps”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| WF-020 | Load workflow detail page | User is logged in, workflow exists | 1. Navigate to /business/apps/workflows/{id} | Workflow detail loads with step form, transition form, steps list, and transitions list. | P0 |
| WF-021 | 404 for non-existent workflow | User is logged in | 1. Navigate to /business/apps/workflows/{invalid_id} | 404 error “Workflow not found” is returned. | P0 |
| WF-022 | Add step to workflow | User owns the workflow | 1. Fill and submit add-step form | Step is added. Success message “Step added!” is returned. | P0 |
| WF-023 | Add step validation failure | User owns the workflow | 1. Submit add-step with invalid data | Returns 400 with form errors. | P1 |
| WF-024 | Update step name and order | User owns the workflow with steps | 1. Submit update-step with step_id, name, and optional order | Step is updated. Returns { success: true }. | P0 |
| WF-025 | Update step fails without step_id or name | User is logged in | 1. Submit update-step without step_id or name | Returns 400 “Missing data”. | P1 |
| WF-026 | Delete step by ID | User owns the workflow with steps | 1. Submit delete-step with step_id | Step is deleted. Returns { success: true }. | P0 |
| WF-027 | Delete step fails without step_id | User is logged in | 1. Submit delete-step without step_id | Returns 400 “Missing step ID”. | P1 |
4. Workflow Detail — Transitions
Section titled “4. Workflow Detail — Transitions”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| WF-030 | Add transition to workflow | User owns the workflow with steps | 1. Fill and submit add-transition form | Transition is added. Success message “Transition added!” is returned. | P0 |
| WF-031 | Add transition validation failure | User owns the workflow | 1. Submit add-transition with invalid data | Returns 400 with form errors. | P1 |
| WF-032 | Update transition name and color | User owns the workflow with transitions | 1. Submit update-transition with transition_id, name, optional color | Transition is updated. Returns { success: true }. | P0 |
| WF-033 | Update transition fails without required fields | User is logged in | 1. Submit update-transition without transition_id or name | Returns 400 “Missing data”. | P1 |
| WF-034 | Delete transition by ID | User owns the workflow with transitions | 1. Submit delete-transition with transition_id | Transition is deleted. Returns { success: true }. | P0 |
| WF-035 | Delete transition fails without transition_id | User is logged in | 1. Submit delete-transition without transition_id | Returns 400 “Missing transition ID”. | P1 |
5. Delete Workflow
Section titled “5. Delete Workflow”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| WF-040 | Delete workflow | User owns the workflow | 1. Submit delete-workflow action | Workflow is deleted. User is redirected to /business/apps/workflows. | P0 |
| WF-041 | Delete workflow requires authentication | User is not logged in | 1. POST to ?/delete-workflow | Returns 401 fail. | P1 |
| WF-042 | Delete workflow handles server error | User is logged in, service throws | 1. Trigger server error during deletion | Returns 500 with error message “Failed to delete workflow”. | P1 |
6. Workflow Instances List
Section titled “6. Workflow Instances List”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| WF-050 | Instances list loads for authenticated user | User is logged in with instances | 1. Navigate to /business/apps/workflows/instances | Page shows all workflow instances for the user. | P0 |
| WF-051 | Instances list empty state | User has no instances | 1. Navigate to /business/apps/workflows/instances | Empty instances array is returned. No crash. | P1 |
| WF-052 | Unauthenticated user gets empty array | User is not logged in | 1. Navigate to /business/apps/workflows/instances | Returns empty instances array. | P1 |
7. Workflow Instance Detail and Execution
Section titled “7. Workflow Instance Detail and Execution”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| WF-060 | Load instance detail page | User is logged in, instance exists | 1. Navigate to /business/apps/workflows/instances/{instanceId} | Instance detail loads with current step, available transitions, and execution log. | P0 |
| WF-061 | 404 for non-existent instance | User is logged in | 1. Navigate to /business/apps/workflows/instances/{invalid_id} | 404 error “Workflow instance not found” is returned. | P0 |
| WF-062 | Perform transition on instance | User is logged in, instance is active | 1. Submit perform-transition with transition_id | Transition is performed. Returns { success: true }. Instance moves to next step. | P0 |
| WF-063 | Perform transition with optional comment | User is logged in | 1. Submit perform-transition with transition_id and comment | Transition is performed with comment recorded in audit log. | P1 |
| WF-064 | Perform transition fails without transition_id | User is logged in | 1. Submit perform-transition without transition_id | Returns 400 “Missing transition ID”. | P1 |
| WF-065 | Perform transition handles server error | User is logged in, service throws | 1. Trigger server error | Returns 500 “Failed to perform transition”. | P1 |
| WF-066 | Cancel workflow instance | User is logged in, instance is active | 1. Submit cancel action | Instance is cancelled. User is redirected to /business/apps/workflows/instances. | P0 |
| WF-067 | Cancel instance requires authentication | User is not logged in | 1. POST to ?/cancel | Returns 401 fail. | P1 |
| WF-068 | Cancel instance handles server error | User is logged in, service throws | 1. Trigger server error during cancellation | Returns 500 “Failed to cancel”. | P1 |