Courses Tests
Dashboard (/business/apps/courses)
Section titled “Dashboard (/business/apps/courses)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-001 | Dashboard loads instructor stats | User has published courses with enrollments | 1. Navigate to /business/apps/courses. | Stats displayed (total courses, total students, completion rates). Up to 5 recent courses shown. | P0 |
| CRS-002 | Dashboard empty state | New instructor, no courses | 1. Navigate to dashboard. | Stats show zeros. Empty state with CTA to create first course. | P1 |
Course List (/business/apps/courses/list)
Section titled “Course List (/business/apps/courses/list)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-010 | List all instructor courses | User has courses | 1. Navigate to /business/apps/courses/list. | All courses listed with title, status, type, and enrollment count. | P0 |
| CRS-011 | Filter by search | User has multiple courses | 1. Enter search term in search field. | Courses matching the search term are shown. | P1 |
| CRS-012 | Filter by status | User has draft and published courses | 1. Set ?status=published. | Only published courses shown. | P1 |
| CRS-013 | Filter by type | User has courses of different types | 1. Set ?type=self-paced. | Only self-paced courses shown. | P2 |
Create Course (/business/apps/courses/new)
Section titled “Create Course (/business/apps/courses/new)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-020 | Create course with valid data | User is signed in | 1. Navigate to /business/apps/courses/new. 2. Fill title, description, price, type, level. 3. Submit form. | Course created. User redirected to /business/apps/courses/{id}?new=1. | P0 |
| CRS-021 | Create course with validation errors | None | 1. Submit form with empty required fields (e.g., missing title). | Returns 400 with form validation errors. Course not created. | P1 |
| CRS-022 | Unauthenticated create redirects | Not signed in | 1. Navigate to /business/apps/courses/new. | Redirected to /login. | P0 |
Course Detail (/business/apps/courses/[id])
Section titled “Course Detail (/business/apps/courses/[id])”Course Management
Section titled “Course Management”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-030 | View course detail with chapters | Course exists with chapters and lessons | 1. Navigate to /business/apps/courses/{id}. | Course details shown. Chapters listed with nested lessons. Enrollment count displayed. Chapter and lesson forms available. | P0 |
| CRS-031 | Publish course | Course is in draft status | 1. Submit publish action. | Course published. published: true returned. Course status changes to published. | P0 |
| CRS-032 | Unpublish course | Course is published | 1. Submit unpublish action. | Course unpublished. unpublished: true returned. Course goes back to draft. | P1 |
| CRS-033 | Delete course | Course exists | 1. Submit delete action. | Course deleted. User redirected to /business/apps/courses/list. | P0 |
| CRS-034 | Access another instructor’s course | Course belongs to different user | 1. Navigate to /business/apps/courses/{other-user-course-id}. | Returns 403 Forbidden. | P0 |
| CRS-035 | Non-existent course returns 404 | None | 1. Navigate to /business/apps/courses/{nonexistent-id}. | Returns 404 “Course not found”. | P1 |
Chapters
Section titled “Chapters”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-040 | Create chapter | Course exists | 1. Fill chapter form (title). 2. Submit create-chapter action. | Chapter created. Success message “Chapter created!” displayed. Chapter appears in course structure. | P0 |
| CRS-041 | Create chapter with validation errors | None | 1. Submit create-chapter with empty title. | Returns 400 with form validation errors. | P1 |
| CRS-042 | Delete chapter | Chapter exists | 1. Submit delete-chapter action with chapter_id. | Chapter deleted. deleted: true returned. Chapter and its lessons removed. | P1 |
| CRS-043 | Delete chapter missing ID | None | 1. Submit delete-chapter without chapter_id. | Returns 400 “Missing chapter ID”. | P2 |
Lessons
Section titled “Lessons”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-050 | Create lesson | Course and chapter exist | 1. Fill lesson form (title, chapter, content type). 2. Submit create-lesson action. | Lesson created. Success message “Lesson created!” displayed. Lesson appears under its chapter. | P0 |
| CRS-051 | Create lesson with validation errors | None | 1. Submit create-lesson with invalid data. | Returns 400 with form validation errors. | P1 |
| CRS-052 | Delete lesson | Lesson exists | 1. Submit delete-lesson action with lesson_id. | Lesson deleted. deleted: true returned. | P1 |
| CRS-053 | Delete lesson missing ID | None | 1. Submit delete-lesson without lesson_id. | Returns 400 “Missing lesson ID”. | P2 |
Edit Course (/business/apps/courses/[id]/edit)
Section titled “Edit Course (/business/apps/courses/[id]/edit)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-060 | Load edit form with existing data | Course exists | 1. Navigate to /business/apps/courses/{id}/edit. | Form pre-populated with title, description, short_description, thumbnail_url, promo_video_url, price, type, level, is_free, and capacity. | P0 |
| CRS-061 | Update course | Course exists | 1. Modify course fields. 2. Submit form. | Course updated. Success message “Course updated!” displayed. | P0 |
| CRS-062 | Update with validation errors | None | 1. Submit with invalid data (e.g., empty title). | Returns 400 with validation errors. | P1 |
| CRS-063 | Non-instructor cannot edit | Course belongs to different instructor | 1. Navigate to edit page for another instructor’s course. | Returns 403. | P0 |
Assignments (/business/apps/courses/[id]/assignments)
Section titled “Assignments (/business/apps/courses/[id]/assignments)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-070 | List assignments | Course has assignments | 1. Navigate to /business/apps/courses/{id}/assignments. | All assignments listed for the course. | P0 |
| CRS-071 | Access control on assignments list | Course belongs to another instructor | 1. Navigate to assignments list for another instructor’s course. | Returns 403. | P0 |
Create Assignment (/business/apps/courses/[id]/assignments/new)
Section titled “Create Assignment (/business/apps/courses/[id]/assignments/new)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-080 | Create assignment | Course exists | 1. Navigate to /business/apps/courses/{id}/assignments/new. 2. Fill assignment form (title, instructions, due date, max points). 3. Submit form. | Assignment created. User redirected to /business/apps/courses/{id}/assignments/{assignmentId}. | P0 |
| CRS-081 | Create assignment with validation errors | None | 1. Submit with empty required fields. | Returns 400 with form validation errors. | P1 |
Assignment Detail (/business/apps/courses/[id]/assignments/[assignmentId])
Section titled “Assignment Detail (/business/apps/courses/[id]/assignments/[assignmentId])”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-090 | View assignment with submissions | Assignment exists with student submissions | 1. Navigate to assignment detail page. | Assignment details, list of submissions, and grade form displayed. | P0 |
| CRS-091 | Grade submission | Submission exists for the assignment | 1. Fill grade form (score, feedback). 2. Submit grade action. | Submission graded. Success message “Submission graded!” displayed. | P0 |
| CRS-092 | Grade with invalid data | None | 1. Submit grade with invalid form data. | Returns 400 with validation errors. | P1 |
| CRS-093 | Return submission with feedback | Submission exists | 1. Submit return action with submission_id and optional feedback. | Submission returned. returned: true displayed. | P1 |
| CRS-094 | Return submission missing ID | None | 1. Submit return without submission_id. | Returns 400 “Missing submission ID”. | P2 |
| CRS-095 | Publish assignment | Assignment in draft | 1. Submit publish action. | Assignment status set to “published”. published: true returned. | P1 |
| CRS-096 | Delete assignment | Assignment exists | 1. Submit delete action. | Assignment deleted. User redirected to assignments list. | P1 |
| CRS-097 | Non-existent assignment returns 404 | None | 1. Navigate to /business/apps/courses/{id}/assignments/{nonexistent}. | Returns 404 “Assignment not found”. | P1 |
Quizzes List (/business/apps/courses/[id]/quizzes)
Section titled “Quizzes List (/business/apps/courses/[id]/quizzes)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-100 | List quizzes for course | Course has quizzes | 1. Navigate to /business/apps/courses/{id}/quizzes. | All quizzes listed for the course. | P0 |
| CRS-101 | Access control on quiz list | Course belongs to another instructor | 1. Navigate to quiz list for another instructor’s course. | Returns 403. | P0 |
Create Quiz (/business/apps/courses/[id]/quizzes/new)
Section titled “Create Quiz (/business/apps/courses/[id]/quizzes/new)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-110 | Create quiz | Course exists | 1. Navigate to new quiz page. 2. Fill form (title, description, time limit, passing score). 3. Submit form. | Quiz created. User redirected to /business/apps/courses/{id}/quizzes/{quizId}. | P0 |
| CRS-111 | Create quiz with validation errors | None | 1. Submit with invalid data. | Returns 400 with form validation errors. | P1 |
Quiz Detail (/business/apps/courses/[id]/quizzes/[quizId])
Section titled “Quiz Detail (/business/apps/courses/[id]/quizzes/[quizId])”Questions Management
Section titled “Questions Management”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-120 | View quiz with questions | Quiz has questions | 1. Navigate to quiz detail. | Quiz details shown. All questions listed with type, content, points, and answers. | P0 |
| CRS-121 | Add multiple choice question | Quiz exists | 1. Fill question form (content, type: multiple_choice, points). 2. Include answers_json with answer options and correct flag. 3. Submit add-question action. | Question added. Success message “Question added!” displayed. | P0 |
| CRS-122 | Add true/false question | Quiz exists | 1. Fill question form with type: true_false. 2. Submit add-question. | Question added with true/false answer structure. | P1 |
| CRS-123 | Add descriptive question | Quiz exists | 1. Fill question form with type: descriptive. 2. Submit add-question. | Question added without predefined answers. | P1 |
| CRS-124 | Add question with validation errors | None | 1. Submit add-question with empty content. | Returns 400 with form validation errors. | P1 |
| CRS-125 | Update question | Question exists | 1. Submit update-question with question_id, modified content, type, points, and answers_json. | Question updated. updated: true returned. | P1 |
| CRS-126 | Update question missing ID | None | 1. Submit update-question without question_id. | Returns 400 “Missing question ID”. | P2 |
| CRS-127 | Delete question | Question exists | 1. Submit delete-question with question_id. | Question deleted. deleted: true returned. | P1 |
| CRS-128 | Reorder questions | Quiz has multiple questions | 1. Submit reorder-questions with ordered_ids JSON array. | Questions reordered. reordered: true returned. | P1 |
Quiz Lifecycle
Section titled “Quiz Lifecycle”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-130 | Publish quiz | Quiz in draft with questions | 1. Submit publish action. | Quiz status set to “published”. published: true returned. | P0 |
| CRS-131 | Unpublish quiz | Quiz is published | 1. Submit unpublish action. | Quiz status set to “draft”. unpublished: true returned. | P1 |
| CRS-132 | Delete quiz | Quiz exists | 1. Submit delete action. | Quiz deleted. User redirected to /business/apps/courses/{id}/quizzes. | P1 |
| CRS-133 | Non-existent quiz returns 404 | None | 1. Navigate to quiz detail with invalid quizId. | Returns 404 “Quiz not found”. | P1 |
Quiz Results (/business/apps/courses/[id]/quizzes/[quizId]/results)
Section titled “Quiz Results (/business/apps/courses/[id]/quizzes/[quizId]/results)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-140 | View quiz results | Quiz has student submissions | 1. Navigate to results page. | All quiz results listed with student name (from profile lookup), score, and completion date. | P0 |
| CRS-141 | Results with student profiles | Results exist with valid user IDs | 1. Navigate to results page. | Student profiles (full_name, username) are resolved and displayed alongside results. | P1 |
| CRS-142 | Results empty state | Quiz has no submissions | 1. Navigate to results page. | Empty results state displayed. No errors. | P1 |
Students (/business/apps/courses/[id]/students)
Section titled “Students (/business/apps/courses/[id]/students)”| Test ID | Description | Preconditions | Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| CRS-150 | View enrolled students | Course has enrollments | 1. Navigate to /business/apps/courses/{id}/students. | All enrolled students listed with profile info (full_name, username, avatar). Enrollment details shown. | P0 |
| CRS-151 | Student profiles resolved | Enrollments exist | 1. Navigate to students page. | Student profiles fetched via service role and displayed correctly. Missing profiles show fallback. | P1 |
| CRS-152 | Empty enrollment list | Course has no students | 1. Navigate to students page for course with zero enrollments. | Empty state displayed. No service role query executed for zero user IDs. | P1 |
| CRS-153 | Access control on students page | Course belongs to another instructor | 1. Navigate to students for another instructor’s course. | Returns 403. | P0 |