Skip to content

Commit 4f207f2

Browse files
authored
Merge pull request #83 from DeepBlueCLtd/feature/e2e-gap-coverage
Feature/e2e gap coverage
2 parents 15343be + 3600180 commit 4f207f2

33 files changed

Lines changed: 2822 additions & 1583 deletions

dita-demo/oxygen-webhelp/template/resources/sonar-quiz.iife.js

Lines changed: 513 additions & 282 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dita-demo/oxygen-webhelp/template/resources/sonar-quiz.iife.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/test-coverage-report.md

Lines changed: 31 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Generated: 2025-11-26
44

55
## Summary
66

7-
- **Total Features**: 12
8-
- **Covered**: 8 (67%)
9-
- **Gaps**: 4
10-
- **E2E Spec Files**: 9
11-
- **Total Tests**: 60
7+
- **Total Features**: 11
8+
- **Covered**: 11 (100%)
9+
- **Gaps**: 0
10+
- **E2E Spec Files**: 12
11+
- **Total Tests**: 82
1212

1313
## Feature Coverage Matrix
1414

@@ -20,47 +20,49 @@ Generated: 2025-11-26
2020
| Quiz interaction (Numeric) | cohort-management.spec.ts | ✅ Covered |
2121
| Analysis table editing | analysis-capture.spec.ts | ✅ Covered |
2222
| Progress tracking (R/A/G badges) | dita-instructor-flow.spec.ts | ✅ Covered |
23-
| Session management (timeout) | - | ❌ Gap |
24-
| Data export (CSV) | - | ❌ Gap |
23+
| Session management (timeout) | session-timeout.spec.ts | ✅ Covered |
24+
| Data export (CSV) | csv-export.spec.ts | ✅ Covered |
2525
| Cohort management (data erasure) | cohort-management.spec.ts | ✅ Covered |
26-
| Storage monitor (debug) | - | ❌ Gap |
27-
| Build info display | - | ❌ Gap |
28-
| PIN authentication | cohort-management.spec.ts | ✅ Covered |
26+
| Build info display | build-info.spec.ts | ✅ Covered |
27+
| PIN authentication | build-info.spec.ts | ✅ Covered |
2928

3029
## Spec File Analysis
3130

3231
| Spec File | Tests | Clicks | Fills | Waits | Assertions |
3332
|-----------|-------|--------|-------|-------|------------|
3433
| analysis-capture.spec.ts | 7 | 10 | 13 | 0 | 18 |
34+
| build-info.spec.ts | 9 | 2 | 3 | 0 | 13 |
3535
| cohort-management.spec.ts | 4 | 27 | 22 | 0 | 50 |
36+
| csv-export.spec.ts | 6 | 19 | 13 | 0 | 36 |
3637
| data-coexistence.spec.ts | 5 | 11 | 20 | 0 | 14 |
3738
| dita-instructor-flow.spec.ts | 4 | 15 | 13 | 1 | 26 |
3839
| dita-student-flow.spec.ts | 12 | 28 | 42 | 1 | 50 |
3940
| instructor-mode-improvements.spec.ts | 8 | 17 | 5 | 0 | 21 |
4041
| instructor-review.spec.ts | 5 | 19 | 8 | 0 | 34 |
4142
| pin-authentication.spec.ts | 8 | 13 | 7 | 6 | 15 |
4243
| progress-tracking.spec.ts | 7 | 9 | 22 | 0 | 16 |
44+
| session-timeout.spec.ts | 7 | 14 | 22 | 0 | 20 |
4345

4446
## Tested Selectors
4547

4648
Top selectors by frequency:
4749

48-
- `qd-login` (9 specs)
49-
- `input[name=` (9 specs)
50-
- `button[type=` (9 specs)
51-
- `qd-status` (9 specs)
52-
- `button` (7 specs)
53-
- `table.qd-quiz` (7 specs)
54-
- `.qd-quiz-input` (7 specs)
55-
- `qd-login[data-ready]` (6 specs)
56-
- `.qd-modal-backdrop input[type=` (5 specs)
57-
- `.qd-modal-backdrop button[type=` (5 specs)
58-
- `#qd-pin-confirmation-ok` (5 specs)
50+
- `qd-login` (12 specs)
51+
- `input[name=` (12 specs)
52+
- `button[type=` (12 specs)
53+
- `qd-status` (12 specs)
54+
- `qd-login[data-ready]` (9 specs)
55+
- `button` (9 specs)
56+
- `table.qd-quiz` (9 specs)
57+
- `.qd-quiz-input` (9 specs)
58+
- `#qd-pin-confirmation-ok` (8 specs)
59+
- `.qd-modal-backdrop input[type=` (7 specs)
60+
- `.qd-modal-backdrop button[type=` (7 specs)
61+
- `View All Scores` (6 specs)
62+
- `qd-login button` (5 specs)
5963
- `td.interactive` (4 specs)
60-
- `View All Scores` (4 specs)
64+
- `.qd-modal-backdrop` (4 specs)
6165
- `table.qd-analysis` (3 specs)
62-
- `qd-login button` (3 specs)
63-
- `.qd-modal-backdrop` (3 specs)
6466
- `.progress-text` (2 specs)
6567
- `.logout-button` (2 specs)
6668
- `qd-instructor` (2 specs)
@@ -70,39 +72,16 @@ Top selectors by frequency:
7072

7173
| Action | Count |
7274
|--------|-------|
73-
| page.click() | 149 |
74-
| page.fill() | 152 |
75+
| page.click() | 184 |
76+
| page.fill() | 190 |
7577
| page.waitForSelector() | 8 |
7678
| page.check() | 2 |
77-
| page.selectOption() | 24 |
78-
| page.goto() | 89 |
79+
| page.selectOption() | 29 |
80+
| page.goto() | 101 |
7981

8082
## Gaps Requiring Attention
8183

82-
### Session management (timeout)
83-
84-
**Feature ID**: session-timeout
85-
**Expected selectors**: session, timeout, lastActivity
86-
**Search keywords**: session, timeout, expire, logout
87-
88-
### Data export (CSV)
89-
90-
**Feature ID**: csv-export
91-
**Expected selectors**: export, csv, download
92-
**Search keywords**: export, csv, download
93-
94-
### Storage monitor (debug)
95-
96-
**Feature ID**: storage-monitor
97-
**Expected selectors**: qd-storage-monitor, debug
98-
**Search keywords**: storage, monitor, debug
99-
100-
### Build info display
101-
102-
**Feature ID**: build-info
103-
**Expected selectors**: qd-build-info, build, version
104-
**Search keywords**: build, version, info
105-
84+
All features have E2E coverage!
10685

10786
---
10887
*This report was generated by `npm run analyze:e2e-gaps`*

scripts/analyze-e2e-gaps.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ const FEATURES = [
7575
selectors: ['erase', 'clear', 'cohort', 'data-clear'],
7676
keywords: ['erase', 'clear', 'cohort', 'delete'],
7777
},
78-
{
79-
id: 'storage-monitor',
80-
name: 'Storage monitor (debug)',
81-
selectors: ['qd-storage-monitor', 'debug'],
82-
keywords: ['storage', 'monitor', 'debug'],
83-
},
8478
{
8579
id: 'build-info',
8680
name: 'Build info display',

src/components/qd-instructor/qd-instructor.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { StudentRecord, SessionData } from '../../types/contracts.js';
1010
import { STORAGE_KEYS } from '../../types/contracts.js';
1111
import { getJSON } from '../../utils/storage-helpers.js';
1212
import { SessionService } from '../../services/session.js';
13+
import { getStorageService } from '../../services/storage-service.js';
1314
import './qd-instructor-unlock.js';
1415
import './qd-instructor-scores.js';
1516
import './qd-instructor-export.js';
@@ -65,6 +66,8 @@ export class QdInstructor extends LitElement {
6566
const isInstructor = sessionStorage.getItem(STORAGE_KEYS.INSTRUCTOR) === 'true';
6667
if (isInstructor) {
6768
this.unlock();
69+
// Load students data for export button
70+
void this.loadStudents();
6871
}
6972

7073
// Restore toggle state from sessionStorage
@@ -117,6 +120,8 @@ export class QdInstructor extends LitElement {
117120
// Auto-unlock if instructor logged in
118121
if (role === 'instructor') {
119122
this.unlock();
123+
// Load students data for export button
124+
void this.loadStudents();
120125
}
121126
};
122127

@@ -132,6 +137,23 @@ export class QdInstructor extends LitElement {
132137
this.students = students;
133138
}
134139

140+
/**
141+
* Load students from storage for current release
142+
*/
143+
private async loadStudents(): Promise<void> {
144+
const session = getJSON<SessionData>(STORAGE_KEYS.SESSION);
145+
if (!session) return;
146+
147+
try {
148+
const storageService = getStorageService();
149+
const students = await storageService.getStudentsByRelease(session.release);
150+
this.students = students;
151+
} catch (err) {
152+
console.error('Failed to load students:', err);
153+
this.students = [];
154+
}
155+
}
156+
135157
/**
136158
* Unlock instructor panel (call after successful auth)
137159
*/
@@ -154,7 +176,6 @@ export class QdInstructor extends LitElement {
154176
if (!session) return;
155177

156178
try {
157-
const { getStorageService } = await import('../../services/storage-service.js');
158179
const storageService = getStorageService();
159180
const students = await storageService.getStudentsByRelease(session.release);
160181
this.students = students;
@@ -197,7 +218,6 @@ export class QdInstructor extends LitElement {
197218
if (!session) return;
198219

199220
try {
200-
const { getStorageService } = await import('../../services/storage-service.js');
201221
const storageService = getStorageService();
202222
const students = await storageService.getStudentsByRelease(session.release);
203223
this.students = students;
@@ -253,7 +273,6 @@ export class QdInstructor extends LitElement {
253273
const session = getJSON<SessionData>(STORAGE_KEYS.SESSION);
254274
if (session) {
255275
try {
256-
const { getStorageService } = await import('../../services/storage-service.js');
257276
const storageService = getStorageService();
258277
const students = await storageService.getStudentsByRelease(session.release);
259278
this.students = students;

0 commit comments

Comments
 (0)