Betygsregistrering - Test Cases
Version: 3.0
Created: 2025-11-18
Status: Active
Purpose: Manual testing scenarios for Betygsregistrering multi-role mockup
Introduction
This document contains comprehensive test cases for the Betygsregistrering (Grade Registration) function. Test cases cover all three user roles: Teacher, Student, and Custodian. Tests are designed for manual execution in a web browser.
Scope
- Teacher view: Full grade registration and management functionality
- Student view: Read-only view of own published grades
- Custodian view: Read-only view of child's published grades
Test Environment
- Base URL:
http://localhost:8888/Mockups/Functions/Betygsregistrering/3/ - Views:
- Landing page:
index.html - Teacher:
teacher.html - Student:
student.html - Custodian:
custodian.html
- Landing page:
Personas Used
- Teacher: Kerstin Berg (T5004-002) - Ämneslärare SV, Proximaskolan, Class 9A
- Student: Anna Andersson (S5004-701) - Elev åk 9, Proximaskolan, Class 9A
- Custodian: Eva Andersson (C5004-701A) - Vårdnadshavare to Anna Andersson
Test Cases - Landing Page
LP-01: Landing page loads correctly
Preconditions: Navigate to http://localhost:8888/Mockups/Functions/Betygsregistrering/3/index.html
Steps:
- Verify page loads without errors
- Check that heading displays "Betygsregistrering"
- Verify version badge shows "Version 3"
- Confirm three view cards are visible: Lärarvyn, Elevvyn, Vårdnadshavarvyn
Expected Result: Landing page displays correctly with all elements visible
LP-02: View card links work
Steps:
- Click on "Lärarvyn" card
- Verify teacher.html loads
- Go back to landing page
- Click on "Elevvyn" card
- Verify student.html loads
- Go back to landing page
- Click on "Vårdnadshavarvyn" card
- Verify custodian.html loads
Expected Result: All view links navigate to correct pages
LP-03: Documentation links work
Steps:
- Click on "Förstudie" link
- Verify pre-study.md opens
- Click on "Specifikation" link
- Verify specification.md opens
- Click on "Testfall" link
- Verify test-cases.md opens
- Click on "Supportartikel" link
- Verify support-article.md opens
Expected Result: All documentation links work correctly
LP-04: Responsive design
Steps:
- Resize browser to mobile width (< 768px)
- Verify cards stack vertically
- Verify text remains readable
- Resize to tablet width (768-1024px)
- Verify responsive grid adapts
- Resize to desktop width (> 1024px)
- Verify optimal layout
Expected Result: Page adapts to all screen sizes correctly
Test Cases - Teacher View
TC-T-01: Teacher view loads correctly
Preconditions: Navigate to http://localhost:8888/Mockups/Functions/Betygsregistrering/3/teacher.html
Steps:
- Verify page loads without JavaScript errors (check console)
- Check that user is "Kerstin Berg" in top-right
- Verify navigation menu shows teacher menu items
- Confirm "BEDÖMNING" menu is expanded with Betygsregistrering active
- Verify page title is "Betygsregistrering"
Expected Result: Teacher page loads correctly with proper persona and menu
TC-T-02: Register term grades in primary school (LGR22)
Based on: specification.md [01]
Steps:
- Select curriculum: "Grundskola (LGR22)"
- Select class: "Klass 9A"
- Verify grade table shows students from 9A
- Select student "Anna Andersson"
- Find subject "Svenska"
- Click grade dropdown
- Select grade "A" from A-F scale
- Verify grade saves automatically
- Verify grade is marked as "Utkast" (draft)
Expected Result: Grade is registered correctly with LGR22 scale (A-F)
TC-T-03: Register course grades in gymnasium (LGY11, LGY25)
Based on: specification.md [02]
Steps:
- Select curriculum: "Gymnasium kursbetyg (LGY11)"
- Select appropriate class
- Register grade for a student
- Verify grade scale is A-F
- Switch to "Gymnasium ämnesbetyg (LGY25)"
- Verify grade scale remains A-F
- Verify subject/course codes are validated
Expected Result: Gymnasium grades use correct A-F scale for both LGY11 and LGY25
TC-T-04: Register grades in adapted primary school (LGRA22)
Based on: specification.md [04]
Steps:
- Select curriculum: "Anpassad grundskola (LGRA22)"
- Find integrated student "Erik Svensson"
- Verify grade scale shows A-E, -, 1
- Select grade "C"
- Verify grade saves
- Test "1" (deltagit) option is available
Expected Result: Adapted school scale (A-E, -, 1) is available for integrated students
TC-T-05: Mark grade as definitive
Based on: specification.md [01] - Acceptanskriterier
Steps:
- Register a grade for a student (e.g., "B" in Svenska)
- Check the "Definitiv" checkbox for that grade
- Verify confirmation dialog appears
- Enter publish date (e.g., "2025-12-15")
- Check confirmation checkbox
- Click "Markera som definitiva"
- Verify grade status changes to "Definitiv"
- Verify publish date is displayed
- Verify grade cannot be edited anymore (should be locked logic)
Expected Result: Grade is marked as definitive with publish date set
TC-T-06: Obligatory notes for F or - grades
Based on: specification.md [01] - Acceptanskriterier
Steps:
- Select a student
- Set grade to "F" for any subject
- Verify note dialog appears automatically
- Try to save without entering note
- Verify validation error occurs
- Enter note: "MA: Eleven har inte nått kunskapskraven pga hög frånvaro"
- Save note
- Verify note is attached to grade
- Repeat for "-" grade
- Verify note is also required for "-"
Expected Result: F and - grades require obligatory notes
TC-T-07: Final grade marking (Slutbetyg)
Based on: specification.md [01] - Acceptanskriterier
Steps:
- Select class 9A (år skurs 9)
- Verify "Slutbetyg" checkbox is available
- Check "Slutbetyg" for a grade
- Verify checkbox saves
- Select a student in year 7
- Verify "Slutbetyg" checkbox is NOT available (only yr 9)
- For gymnasium year 3, verify "Slutbetyg" IS available
Expected Result: Final grade checkbox only available in final year (9, 10, or gymnasium year 3)
TC-T-08: Course code validation
Based on: specification.md [01] - Acceptanskriterier
Steps:
- Enter an invalid course code
- Verify error message appears: "Ämneskoden du har angivit är inte giltig enligt Skolverkets register"
- Enter a valid course code (e.g., "MA", "SV", "EN")
- Verify grade can be registered
Expected Result: Invalid course codes are rejected with proper error message
TC-T-09: Bulk actions - Mark multiple as definitive
Steps:
- Select multiple students using checkboxes
- Verify bulk actions bar appears at bottom
- Verify selected count is correct
- Click "Markera som definitiva"
- Set publish date
- Confirm action
- Verify all selected grades are marked as definitive
- Click "Avmarkera alla"
- Verify all checkboxes are cleared
Expected Result: Bulk actions work for multiple students
TC-T-10: Student detail modal
Steps:
- Click on a student row or "view details" icon
- Verify student detail dialog opens
- Check student information: Name, Personal number, Class, Curriculum
- Verify grade history table shows all grades for that student
- Verify data is correctly populated
- Close dialog
Expected Result: Student details display correctly with grade history
TC-T-11: Filter functionality
Steps:
- Test curriculum filter: Select different curricula
- Verify grade table updates to show only matching students
- Test class filter: Select different classes
- Verify students from selected class are shown
- Test subject filter: Select specific subject
- Verify only grades for that subject are shown
- Test period filter: Select different terms
- Verify grades from selected term are shown
- Click "Återställ filter"
- Verify all filters are reset
Expected Result: All filters work correctly and can be reset
TC-T-12: Search students
Steps:
- Enter student name in search field: "Anna"
- Verify table filters to show matching students
- Enter partial name: "And"
- Verify matching results
- Clear search
- Verify all students are shown again
Expected Result: Student search filters table correctly
TC-T-13: Status cards update
Steps:
- Note initial status card values (Utkast, Definitiva, Väntar publicering, Låsta)
- Register new grade
- Verify "Utkast" count increases
- Mark grade as definitive
- Verify "Definitiva" count increases
- Set future publish date
- Verify "Väntar publicering" count increases
Expected Result: Status cards update in real-time
TC-T-14: FAB (Floating Action Button) quick actions
Steps:
- Click FAB button (bottom-right)
- Verify menu appears with quick actions
- Click "MARKERA ALLA DEFINITIVA"
- Verify appropriate action triggers
- Test other FAB actions
Expected Result: FAB provides quick access to common actions
TC-T-15: Dark mode functionality
Steps:
- Click user avatar/name in top-right
- Click "Mörkt läge"
- Verify page switches to dark theme
- Verify all colors are appropriately inverted
- Verify text remains readable
- Toggle back to light mode
- Verify theme switches correctly
Expected Result: Dark mode works without visual issues
TC-T-16: Language switching (Svenska/English)
Steps:
- Click user menu
- Click "Byt till engelska"
- Verify UI text translates to English:
- Menu items (Profile, Settings, etc.)
- Page headings (Grade Registration → Grade Registration)
- Button labels (Spara → Save, Avbryt → Cancel)
- Verify student names remain in Swedish (data-user-content)
- Switch back to Swedish
- Verify all text returns to Swedish
Expected Result: Language toggle works, UI translates but user content remains Swedish
TC-T-17: Responsive design (Desktop/Tablet)
Steps:
- View on desktop (> 1024px)
- Verify table displays correctly with all columns
- Resize to tablet (768-1024px)
- Verify responsive behavior
- Verify menu can collapse
- Test collapsed menu functionality
Expected Result: Teacher view is usable on desktop and tablet devices
Test Cases - Student View
TC-S-01: Student view loads correctly
Preconditions: Navigate to http://localhost:8888/Mockups/Functions/Betygsregistrering/3/student.html
Steps:
- Verify page loads without JavaScript errors
- Check user is "Anna Andersson"
- Verify student navigation menu is shown
- Verify "MINA BETYG" is highlighted/active
- Verify page title is "Mina betyg"
Expected Result: Student page loads with Anna Andersson persona
TC-S-02: Only published grades are visible
Steps:
- Check grades displayed on page
- Verify only grades with:
- publishDate <= today
- showToStudent = true
- definitive = true
- Count visible grades
- Compare with data.js - verify unpublished grades (MU, SH) are hidden
- Verify published grades (MA, EN, SV, BI, HI, IDH) are shown
Expected Result: Only 6 published grades visible, 2 unpublished grades hidden
TC-S-03: Grade cards display correctly
Steps:
- Verify each grade is shown as a card
- Check card includes: Subject name, Current grade, Teacher name, Publish date
- Verify grade color coding (A=green, B=green, C=yellow, etc.)
- Verify readable text and icons
Expected Result: Grade cards display all required information clearly
TC-S-04: View grade details
Steps:
- Click on a grade card (e.g., "Matematik - A")
- Verify detail dialog opens
- Check dialog shows: Subject, Grade, Term, Publish date, Teacher name
- If grade has note, verify it's displayed
- Verify grade history table shows previous grades for that subject
- Close dialog
Expected Result: Grade details display correctly with history
TC-S-05: No editing capabilities
Steps:
- Look for edit buttons, dropdowns, or input fields
- Verify NO editing controls are present
- Verify NO "Definitiv" checkbox
- Verify NO bulk actions bar
- Verify NO FAB button
- Confirm view is completely read-only
Expected Result: Student cannot edit or modify any grades
TC-S-06: Filter by term
Steps:
- Select "Hösttermin 2024 (20251)" filter
- Verify only grades from period 20251 are shown
- Select "Vårtermin 2025 (20252)"
- Verify only grades from period 20252 are shown (should be empty or limited)
- Select "Alla terminer"
- Verify all published grades are shown
Expected Result: Term filter works correctly
TC-S-07: Filter by subject
Steps:
- Select specific subject from dropdown (e.g., "Matematik")
- Verify only Matematik grade is shown
- Select different subject
- Verify filter updates correctly
- Select "Alla ämnen"
- Verify all grades are shown
Expected Result: Subject filter works correctly
TC-S-08: Empty state display
Steps:
- Modify data.js temporarily to make no grades published
- Reload page
- Verify empty state shows: "Inga betyg publicerade än"
- Verify message explains that grades will appear when published
- Restore data.js
Expected Result: Empty state displays correctly when no published grades
TC-S-09: Grade statistics cards
Steps:
- Verify status cards at top show:
- "Ämnen": Count of subjects with published grades
- "Publicerade betyg": Count of published grades
- "Medelbetyg": Average grade (A, B, C, etc.)
- Verify counts are correct
Expected Result: Statistics cards show accurate information
TC-S-10: Information panel
Steps:
- Scroll to bottom
- Verify "Information om betyg" section is present
- Verify grade scale explanations (A-F meanings)
- Verify "Frågor om betyg?" help message
Expected Result: Helpful information is displayed
TC-S-11: Dark mode (Student)
Steps:
- Toggle dark mode from user menu
- Verify page switches to dark theme
- Verify grade cards remain readable
- Verify color coding still works in dark mode
- Toggle back to light mode
Expected Result: Dark mode works correctly for student view
TC-S-12: Language switching (Student)
Steps:
- Switch to English
- Verify UI text translates
- Verify Anna Andersson's name stays in Swedish
- Verify subject names translate if in glossary
- Switch back to Swedish
Expected Result: Language toggle works correctly
TC-S-13: Mobile responsive design
Steps:
- View on mobile screen (< 768px)
- Verify grade cards stack vertically
- Verify touch targets are large enough (min 44px)
- Test menu toggle works on mobile
- Verify filters are accessible
- Test dialog opens and is usable on mobile
Expected Result: Student view is fully functional on mobile devices
Test Cases - Custodian View
TC-C-01: Custodian view loads correctly
Preconditions: Navigate to http://localhost:8888/Mockups/Functions/Betygsregistrering/3/custodian.html
Steps:
- Verify page loads without errors
- Check user is "Eva Andersson"
- Verify simplified custodian menu is shown
- Verify "RESULTAT" is active
- Verify page title shows "Annas betyg"
Expected Result: Custodian page loads with Eva Andersson viewing Anna's grades
TC-C-02: Only child's published grades visible
Steps:
- Verify only Anna Andersson's grades are shown
- Confirm no other students' grades are visible
- Verify same published/unpublished logic as student view
- Count grades: should match Anna's published grades from student view
Expected Result: Only Anna's published grades (6 subjects) are visible
TC-C-03: Grade scale help section
Steps:
- Locate "Vad betyder betygen?" section
- Verify all grade levels are explained:
- A: Mycket hög kunskapsnivå
- B: Hög kunskapsnivå
- C: God kunskapsnivå
- D: Tillfredställande kunskapsnivå
- E: Godkänd kunskapsnivå
- F: Ej godkänd
- -: Betyg saknas
- Verify color badges match grade levels
Expected Result: Grade scale explanations are clear and visible
TC-C-04: Simple grade card layout
Steps:
- Verify grades are displayed as simple cards (not complex table)
- Each card should show: Subject, Grade (large), Teacher, Last updated
- Verify cards have clear visual hierarchy
- Verify grade is prominently displayed
Expected Result: Cards are simple and mobile-friendly
TC-C-05: Contact teacher button
Steps:
- Locate "Kontakta lärare" button
- Verify button is prominent (full-width, large)
- Verify button has icon and text label
- Click button
- Verify appropriate action occurs (or placeholder message)
Expected Result: Contact teacher button is easily accessible
TC-C-06: View grade details
Steps:
- Click on a grade card
- Verify detail dialog opens
- Check information displayed:
- Subject (large, clear)
- Grade (very large, 3rem font)
- Term
- Publish date
- Teacher name (in Swedish, data-user-content)
- If note exists, verify it's shown
- Verify "Tidigare betyg" (grade history) section
- Close dialog
Expected Result: Grade details are very clear and simple for parents
TC-C-07: No editing capabilities
Steps:
- Verify no edit buttons anywhere
- Verify no grade dropdowns
- Verify no checkboxes
- Verify completely read-only
- Verify no bulk actions
- Verify no FAB
Expected Result: Custodian cannot edit anything
TC-C-08: Dark mode (Custodian)
Steps:
- Toggle dark mode
- Verify high contrast is maintained
- Verify grade cards remain readable
- Verify grade scale help section works in dark mode
- Toggle back to light mode
Expected Result: Dark mode works with high contrast
TC-C-09: Language switching (Custodian)
Steps:
- Switch to English
- Verify UI translates
- Verify "Annas betyg" → "Anna's grades" (or similar)
- Verify teacher names stay in Swedish
- Switch back to Swedish
Expected Result: Language toggle works appropriately
TC-C-10: Mobile-first design (Smartphone)
Steps:
- View on smartphone screen (< 480px)
- Verify touch targets are 48px minimum
- Verify text is large and readable
- Verify grade cards stack nicely
- Test menu navigation
- Test dialog usability
- Verify no horizontal scrolling
- Test pinch-to-zoom is enabled (user-scalable=yes)
Expected Result: Custodian view is optimized for smartphone use
TC-C-11: Grade card interaction
Steps:
- Tap on a grade card
- Verify visual feedback (hover/active state)
- Verify card expands or opens dialog smoothly
- Verify back button returns to list
- Test multiple cards in sequence
Expected Result: Card interactions are smooth and intuitive
Cross-Role Test Cases
TC-X-01: Data consistency across views
Steps:
- Open teacher view, note a specific published grade (e.g., Anna's Math = A)
- Open student view
- Verify same grade appears with same value
- Open custodian view
- Verify same grade appears with same value
- Verify all three views show consistent data
Expected Result: Published grades are consistent across all views
TC-X-02: Unpublished grades visibility
Steps:
- In teacher view, identify an unpublished grade (not marked definitive)
- Note the student and subject
- Switch to student view (same student)
- Verify unpublished grade is NOT visible
- Switch to custodian view
- Verify unpublished grade is NOT visible
Expected Result: Only teacher sees unpublished/draft grades
TC-X-03: Publish workflow verification
Steps:
- Teacher view: Create new grade for Anna (e.g., "Kemi = B")
- Verify grade is "Utkast"
- Check student view: verify grade is NOT visible yet
- Back to teacher: Mark grade as definitive with past publish date
- Refresh student view: verify grade NOW appears
- Check custodian view: verify grade also appears
Expected Result: Publishing workflow works correctly across roles
TC-X-04: Navigation from landing page
Steps:
- Start at landing page
- Navigate to each view in sequence
- Use browser back button
- Verify landing page is accessible
- Test all three view cards
- Verify smooth navigation
Expected Result: Navigation between views is seamless
TC-X-05: Grade period filtering cross-view
Steps:
- Teacher view: Note which grades are in period 20251 vs 20252
- Student view: Filter by "Hösttermin 2024 (20251)"
- Verify only period 20251 published grades show
- Verify count matches expectation
- Custodian view: (No period filter, but verify only relevant grades)
Expected Result: Period filtering is consistent with data
Accessibility Test Cases
TC-A-01: Keyboard navigation
Steps:
- Use only keyboard (Tab, Enter, Escape)
- Navigate through all views
- Verify all interactive elements are reachable
- Verify focus indicators are visible
- Test skip links (Tab on page load)
- Verify skip to navigation and skip to content work
Expected Result: All functionality is keyboard accessible
TC-A-02: Screen reader compatibility
Steps:
- Enable screen reader (VoiceOver on Mac, NVDA on Windows)
- Navigate landing page
- Verify all cards are announced correctly
- Navigate teacher view
- Verify table headers are announced
- Verify aria-labels are present and correct
- Test student and custodian views
Expected Result: Screen readers can navigate and understand all content
TC-A-03: Color contrast
Steps:
- Verify all text meets WCAG AA standards (4.5:1 for normal text, 3:1 for large text)
- Check grade badges have sufficient contrast
- Verify links are distinguishable
- Test in dark mode as well
Expected Result: All text meets accessibility contrast requirements
Error Handling Test Cases
TC-E-01: Network error handling
Steps:
- Simulate network failure (disable internet or block requests)
- Try to load page
- Verify graceful degradation
- Verify error messages are user-friendly
Expected Result: Errors are handled gracefully with helpful messages
TC-E-02: Missing data handling
Steps:
- Modify data.js to remove mockGrades array
- Reload teacher view
- Verify empty state shows correctly
- Verify no JavaScript errors
- Restore data
Expected Result: Missing data is handled without crashes
TC-E-03: Invalid grade entry
Steps:
- Teacher view: Try to enter invalid grade
- Verify validation prevents invalid entry
- Verify error message explains issue
Expected Result: Invalid data is rejected with helpful feedback
Performance Test Cases
TC-P-01: Page load time
Steps:
- Open browser dev tools → Network tab
- Clear cache
- Load each view
- Verify load time < 3 seconds on good connection
- Check number of requests
- Verify no unnecessary data loading
Expected Result: Pages load quickly and efficiently
TC-P-02: Large data set handling
Steps:
- Modify data.js to include 100+ students
- Load teacher view
- Verify table renders smoothly
- Test scrolling performance
- Test filter performance
- Restore data
Expected Result: Application handles larger data sets reasonably
Browser Compatibility Test Cases
TC-B-01: Chrome/Edge compatibility
Steps:
- Test all views in Chrome
- Verify full functionality
- Test in Edge
- Verify consistency
Expected Result: Works perfectly in Chrome/Edge
TC-B-02: Firefox compatibility
Steps:
- Test all views in Firefox
- Check for layout differences
- Test all interactive features
- Verify no Firefox-specific issues
Expected Result: Works correctly in Firefox
TC-B-03: Safari compatibility
Steps:
- Test all views in Safari (Mac/iOS)
- Check for WebKit-specific rendering issues
- Test on iPhone/iPad
- Verify mobile functionality
Expected Result: Works correctly in Safari
Summary
Total Test Cases: 51
- Landing Page: 4 tests
- Teacher View: 17 tests
- Student View: 13 tests
- Custodian View: 11 tests
- Cross-Role: 5 tests
- Accessibility: 3 tests
- Error Handling: 3 tests
- Performance: 2 tests
- Browser Compatibility: 3 tests
Critical Tests
Priority 1 (Must Pass):
- TC-T-02: Register grades correctly
- TC-T-06: Obligatory notes for F/-
- TC-S-02: Only published grades visible
- TC-C-02: Only child's grades visible
- TC-X-02: Unpublished grades hidden from student/custodian
- TC-X-03: Publish workflow
Priority 2 (Should Pass):
- All language switching tests
- All dark mode tests
- All responsive design tests
- All accessibility tests
Priority 3 (Nice to Have):
- Performance tests
- Cross-browser tests
Test Execution Log
Test Session: [Date]
Tester: [Name]
Browser: [Browser + Version]
OS: [Operating System]
| Test ID | Status | Notes |
|---|---|---|
| LP-01 | ||
| LP-02 | ||
| TC-T-01 | ||
| ... |
Status Legend:
- ✅ Pass
- ❌ Fail
- ⚠️ Partial
- ⏭️ Skipped
- 🔄 Retest needed
Known Limitations (Mock Environment)
- No real API: All data changes are client-side only (lost on refresh)
- No authentication: User roles are simulated via URL/script
- Auto-locking: 20-day lock not implemented (would require backend)
- Course code validation: Limited to mock registry
- Export functionality: Placeholder only
- Email/notifications: Simulated, not real
These limitations are expected for a mockup and don't affect testing of UI/UX.
Revision History
| Version | Date | Changes |
|---|---|---|
| 3.0 | 2025-11-18 | Initial test cases for multi-role implementation |