-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevice-testing-checklist.html
More file actions
911 lines (807 loc) · 35.8 KB
/
device-testing-checklist.html
File metadata and controls
911 lines (807 loc) · 35.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Device Testing Checklist</title>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
:root {
--bg: #FAF5EB;
--surface: #FFFFFF;
--surface-2: #F0EBE1;
--border: #D9D3C7;
--border-focus: #F29B00;
--accent: #F29B00;
--accent-press: #D98A00;
--text: #272727;
--text-sub: #5C5852;
--text-muted: #9E9889;
--pass: #2E7D32;
--pass-bg: rgba(46,125,50,0.08);
--fail: #C62828;
--fail-bg: rgba(198,40,40,0.08);
--na: #9E9889;
--na-bg: rgba(158,152,137,0.08);
--warn: #F29B00;
--radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'DM Sans', sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
line-height: 1.5;
}
.app {
position: relative;
z-index: 1;
max-width: 960px;
margin: 0 auto;
padding: 32px 20px 80px;
}
/* ── Header ── */
.header {
display: flex;
align-items: center;
gap: 16px;
margin-bottom: 32px;
padding-bottom: 24px;
border-bottom: 1px solid var(--border);
}
.logo {
width: 48px;
height: 48px;
background: var(--accent);
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-family: 'JetBrains Mono', monospace;
font-weight: 700;
font-size: 20px;
color: #fff;
flex-shrink: 0;
}
.header-text h1 {
font-size: 22px;
font-weight: 700;
letter-spacing: -0.5px;
color: var(--text);
}
.header-text p {
font-size: 13px;
color: var(--text-muted);
margin-top: 2px;
}
.version-badge {
margin-left: auto;
font-family: 'JetBrains Mono', monospace;
font-size: 11px;
color: var(--accent);
background: rgba(242,155,0,0.1);
border: 1px solid rgba(242,155,0,0.25);
padding: 4px 10px;
border-radius: 20px;
white-space: nowrap;
}
/* ── Meta Fields ── */
.meta-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 12px;
margin-bottom: 28px;
}
.meta-field {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 12px 14px;
display: flex;
flex-direction: column;
gap: 4px;
}
.meta-field label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.8px;
color: var(--text-muted);
font-weight: 600;
}
.meta-field input, .meta-field select {
background: transparent;
border: none;
color: var(--text);
font-family: 'JetBrains Mono', monospace;
font-size: 14px;
outline: none;
width: 100%;
}
.meta-field select {
cursor: pointer;
-webkit-appearance: none;
appearance: none;
}
.meta-field select option {
background: var(--surface);
color: var(--text);
}
/* ── Progress Bar ── */
.progress-bar-container {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 16px 18px;
margin-bottom: 28px;
}
.progress-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.progress-header span {
font-size: 13px;
color: var(--text-muted);
font-weight: 500;
}
.progress-header .progress-pct {
font-family: 'JetBrains Mono', monospace;
font-size: 14px;
color: var(--accent);
font-weight: 600;
}
.progress-track {
height: 6px;
background: var(--surface-2);
border-radius: 3px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: var(--accent);
border-radius: 3px;
transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
width: 0%;
}
.progress-stats { display: flex; gap: 20px; margin-top: 10px; }
.stat { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-dot.pass { background: var(--pass); }
.stat-dot.fail { background: var(--fail); }
.stat-dot.na { background: var(--na); }
.stat-dot.pending { background: var(--border); }
.stat-count { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--text); }
.stat-label { color: var(--text-muted); }
/* ── Sections ── */
.section {
margin-bottom: 20px;
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
background: var(--surface);
}
.section-header {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 18px;
background: var(--surface-2);
cursor: pointer;
user-select: none;
transition: background 0.2s;
}
.section-header:hover { background: #E8E3D9; }
.section-icon {
width: 32px; height: 32px; border-radius: 8px;
display: flex; align-items: center; justify-content: center;
font-size: 16px; flex-shrink: 0;
}
.section-header h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; flex: 1; color: var(--text); }
.section-count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); }
.section-chevron { color: var(--text-muted); transition: transform 0.25s ease; font-size: 14px; }
.section.collapsed .section-chevron { transform: rotate(-90deg); }
.section.collapsed .section-body { display: none; }
.section-body { padding: 4px 0; }
/* ── Check Items ── */
.check-item {
display: grid;
grid-template-columns: 1fr auto auto;
align-items: center;
gap: 12px;
padding: 10px 18px;
border-bottom: 1px solid var(--surface-2);
transition: background 0.15s;
}
.check-item:last-child { border-bottom: none; }
.check-item:hover { background: rgba(242,155,0,0.03); }
.check-item.status-pass { background: var(--pass-bg); }
.check-item.status-fail { background: var(--fail-bg); }
.check-label { font-size: 13.5px; color: var(--text); line-height: 1.4; }
.check-label .threshold {
font-family: 'JetBrains Mono', monospace;
font-size: 11px; color: var(--warn);
background: rgba(242,155,0,0.1);
padding: 1px 6px; border-radius: 4px;
margin-left: 6px; white-space: nowrap;
}
.check-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-check {
width: 34px; height: 34px; border-radius: 8px;
border: 1.5px solid var(--border); background: transparent;
color: var(--text-muted); cursor: pointer;
display: flex; align-items: center; justify-content: center;
font-size: 15px; transition: all 0.2s; font-family: 'DM Sans', sans-serif;
}
.btn-check:hover { border-color: var(--text-sub); background: var(--surface-2); }
.btn-check.active-pass { background: var(--pass-bg); border-color: var(--pass); color: var(--pass); }
.btn-check.active-fail { background: var(--fail-bg); border-color: var(--fail); color: var(--fail); }
.btn-check.active-na { background: var(--na-bg); border-color: var(--na); color: var(--na); }
.comment-toggle {
width: 34px; height: 34px; border-radius: 8px;
border: 1.5px solid var(--border); background: transparent;
color: var(--text-muted); cursor: pointer;
display: flex; align-items: center; justify-content: center;
font-size: 13px; transition: all 0.2s; flex-shrink: 0;
}
.comment-toggle:hover { border-color: var(--text-sub); }
.comment-toggle.has-comment { border-color: var(--accent); color: var(--accent); background: rgba(242,155,0,0.08); }
.comment-row { padding: 0 18px 10px 18px; display: none; }
.comment-row.visible { display: block; }
.comment-row textarea {
width: 100%; background: var(--surface-2);
border: 1px solid var(--border); border-radius: 8px;
color: var(--text); font-family: 'DM Sans', sans-serif;
font-size: 13px; padding: 8px 12px; resize: vertical;
min-height: 36px; outline: none; transition: border-color 0.2s;
}
.comment-row textarea:focus { border-color: var(--border-focus); }
/* ── Cosmetic Grade ── */
.grade-selector { display: flex; gap: 8px; padding: 14px 18px; }
.grade-btn {
flex: 1; padding: 10px; border-radius: 8px;
border: 1.5px solid var(--border); background: transparent;
color: var(--text-muted); cursor: pointer; text-align: center;
transition: all 0.2s; font-family: 'DM Sans', sans-serif;
}
.grade-btn:hover { border-color: var(--text-sub); background: var(--surface-2); }
.grade-btn.selected { border-color: var(--accent); background: rgba(242,155,0,0.08); color: var(--accent-press); }
.grade-btn .grade-letter { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; display: block; margin-bottom: 2px; }
.grade-btn .grade-desc { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
/* ── Tech Notes ── */
.tech-notes-area { padding: 14px 18px; }
.tech-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tech-note-field { display: flex; flex-direction: column; gap: 4px; }
.tech-note-field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); font-weight: 600; }
.tech-note-field input, .tech-note-field textarea {
background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
color: var(--text); font-family: 'JetBrains Mono', monospace;
font-size: 13px; padding: 8px 12px; outline: none; transition: border-color 0.2s;
}
.tech-note-field input:focus, .tech-note-field textarea:focus { border-color: var(--border-focus); }
.tech-note-field.full { grid-column: 1 / -1; }
.tech-note-field textarea { resize: vertical; min-height: 60px; font-family: 'DM Sans', sans-serif; }
/* ── Summary Footer ── */
.summary-footer {
position: fixed; bottom: 0; left: 0; right: 0;
background: rgba(250,245,235,0.92); backdrop-filter: blur(12px);
border-top: 1px solid var(--border); padding: 12px 20px;
z-index: 100; display: flex; align-items: center; justify-content: center; gap: 24px;
}
.summary-footer .summary-item { font-family: 'JetBrains Mono', monospace; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.summary-footer .summary-verdict { padding: 6px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; letter-spacing: 0.3px; }
.verdict-pending { background: var(--na-bg); color: var(--text-muted); border: 1px solid var(--border); }
.verdict-pass { background: var(--pass-bg); color: var(--pass); border: 1px solid rgba(46,125,50,0.3); }
.verdict-fail { background: var(--fail-bg); color: var(--fail); border: 1px solid rgba(198,40,40,0.3); }
.print-btn {
display: flex; align-items: center; gap: 6px; padding: 6px 16px;
border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
color: var(--text-sub); font-family: 'DM Sans', sans-serif;
font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; margin-left: 8px;
}
.print-btn:hover { background: rgba(242,155,0,0.08); border-color: var(--accent); color: var(--accent-press); }
#printOverlay { display: none; }
@media (max-width: 640px) {
.meta-grid { grid-template-columns: 1fr 1fr; }
.tech-notes-grid { grid-template-columns: 1fr; }
.grade-selector { flex-wrap: wrap; }
.grade-btn { min-width: calc(50% - 4px); }
.progress-stats { flex-wrap: wrap; }
.summary-footer { gap: 12px; flex-wrap: wrap; justify-content: center; }
}
/* ── Print Styles ── */
@media print {
*, *::before, *::after { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
body { background: #fff !important; color: #111 !important; font-size: 11px; line-height: 1.4; }
.app, .summary-footer { display: none !important; }
#printOverlay { display: block !important; font-family: 'DM Sans', Arial, sans-serif; padding: 12px; }
#printOverlay * { color: #111 !important; }
.print-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 12px; }
.print-header h1 { font-size: 18px; font-weight: 700; }
.print-header .print-logo { width: 32px; height: 32px; background: #F29B00; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff !important; }
.print-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 16px; margin-bottom: 14px; font-size: 11px; }
.print-meta-item { display: flex; flex-direction: column; }
.print-meta-item .pm-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.6px; color: #666 !important; font-weight: 600; }
.print-meta-item .pm-value { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500; border-bottom: 1px solid #ccc; padding: 2px 0; min-height: 18px; }
.print-verdict-bar { display: flex; align-items: center; gap: 16px; padding: 6px 12px; margin-bottom: 14px; border: 2px solid #111; border-radius: 6px; font-size: 12px; font-weight: 600; }
.print-verdict-bar .pv-stats { display: flex; gap: 12px; font-size: 11px; }
.print-verdict-bar .pv-verdict { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; }
.print-section { margin-bottom: 10px; break-inside: avoid; }
.print-section-title { font-size: 12px; font-weight: 700; background: #f0f0f0; padding: 4px 8px; border-radius: 3px; margin-bottom: 2px; border-left: 3px solid #F29B00; }
.print-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.print-table th { text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: #666 !important; padding: 3px 6px; border-bottom: 1px solid #ccc; }
.print-table td { padding: 3px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.print-table .pt-status { width: 50px; text-align: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 11px; }
.pt-pass { color: #2E7D32 !important; }
.pt-fail { color: #C62828 !important; }
.pt-na { color: #888 !important; }
.pt-pending { color: #bbb !important; }
.print-table .pt-comment { font-size: 9.5px; font-style: italic; color: #555 !important; max-width: 200px; }
.print-grade { display: inline-block; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 14px; border: 2px solid #111; border-radius: 4px; padding: 2px 10px; margin: 4px 0 8px 8px; }
.print-notes-section { margin-top: 10px; break-inside: avoid; }
.print-notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 10.5px; }
.print-notes-grid.full-width { grid-template-columns: 1fr; }
.print-note-item { padding: 3px 0; }
.print-note-item .pn-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: #666 !important; font-weight: 600; }
.print-note-item .pn-value { border-bottom: 1px solid #ccc; min-height: 16px; padding: 1px 0; white-space: pre-wrap; }
.print-footer { margin-top: 20px; padding-top: 8px; border-top: 1px solid #ccc; font-size: 9px; color: #999 !important; display: flex; justify-content: space-between; }
}
</style>
</head>
<body>
<div id="printOverlay"></div>
<div class="app" id="app">
<div class="header">
<div class="logo">✓</div>
<div class="header-text">
<h1>Device Testing Checklist</h1>
<p>Refurbished device quality assurance</p>
</div>
<div class="version-badge">v2.0</div>
</div>
<div class="meta-grid">
<div class="meta-field">
<label>Asset Tag</label>
<input type="text" id="atNumber" placeholder="e.g. AT-10452">
</div>
<div class="meta-field">
<label>Date of Testing</label>
<input type="date" id="testDate">
</div>
<div class="meta-field">
<label>Tested By</label>
<input type="text" id="testedBy" placeholder="Tester name">
</div>
<div class="meta-field">
<label>Device Type</label>
<select id="deviceType" onchange="handleDeviceType()">
<option value="">Select type...</option>
<option value="laptop">Laptop</option>
<option value="desktop">Desktop</option>
<option value="tablet">Tablet</option>
<option value="phone">Phone</option>
<option value="aio">All-in-One</option>
<option value="monitor">Monitor / TV</option>
</select>
</div>
</div>
<div class="progress-bar-container">
<div class="progress-header">
<span>Completion</span>
<span class="progress-pct" id="progressPct">0%</span>
</div>
<div class="progress-track">
<div class="progress-fill" id="progressFill"></div>
</div>
<div class="progress-stats">
<div class="stat"><div class="stat-dot pass"></div><span class="stat-count" id="countPass">0</span><span class="stat-label">Pass</span></div>
<div class="stat"><div class="stat-dot fail"></div><span class="stat-count" id="countFail">0</span><span class="stat-label">Fail</span></div>
<div class="stat"><div class="stat-dot na"></div><span class="stat-count" id="countNa">0</span><span class="stat-label">N/A</span></div>
<div class="stat"><div class="stat-dot pending"></div><span class="stat-count" id="countPending">0</span><span class="stat-label">Pending</span></div>
</div>
</div>
<div id="sections"></div>
</div>
<div class="summary-footer">
<div class="summary-item">
<span style="color:var(--pass);" id="footPass">0</span>
<span style="color:var(--text-muted);">pass</span>
</div>
<div class="summary-item">
<span style="color:var(--fail);" id="footFail">0</span>
<span style="color:var(--text-muted);">fail</span>
</div>
<div class="summary-verdict verdict-pending" id="footVerdict">INCOMPLETE</div>
<button class="print-btn" onclick="printChecklist()" title="Print checklist">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9V2h12v7"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>
Print
</button>
</div>
<script>
const NON_MONITOR = ['laptop','desktop','tablet','phone','aio'];
const checklistData = [
{
id: 'precheck',
title: 'Pre-Test Checks',
icon: '🔍',
iconBg: 'rgba(158,152,137,0.15)',
items: [
{ id: 'pre_icloud', label: 'Device free from iCloud / MDM / BIOS lock', deviceTypes: NON_MONITOR },
{ id: 'pre_charger', label: 'Charger / power cable included and correct wattage' },
{ id: 'pre_partsonly', label: 'Selling for parts only (skip full test if yes)' },
]
},
{
id: 'physical',
title: 'Physical Condition',
icon: '🔧',
iconBg: 'rgba(242,155,0,0.12)',
items: [
{ id: 'phys_damage', label: 'Device free from visible damage (scratches, dents, cracks)' },
{ id: 'phys_screen', label: 'Screen free from dead pixels, cracks, or flickering' },
{ id: 'phys_hinges', label: 'Hinges working smoothly (not too loose or stiff)', deviceTypes: ['laptop'] },
{ id: 'phys_keyboard', label: 'Keyboard fully functional — all keys responsive', deviceTypes: ['laptop','desktop'] },
{ id: 'phys_trackpad', label: 'Trackpad smooth movement, all gestures working', deviceTypes: ['laptop'] },
{ id: 'phys_feet', label: 'Rubber feet / stand intact', deviceTypes: ['laptop','desktop','monitor'] },
{ id: 'phys_bezel', label: 'Bezel and housing free from cracks or warping', deviceTypes: ['monitor'] },
],
hasGrade: true
},
{
id: 'display',
title: 'Display & Ports',
icon: '🖥️',
iconBg: 'rgba(56,139,253,0.12)',
sectionDeviceTypes: ['monitor'],
items: [
{ id: 'disp_power', label: 'Display powers on and shows image correctly', deviceTypes: ['monitor'] },
{ id: 'disp_hdmi', label: 'HDMI port working', deviceTypes: ['monitor'] },
{ id: 'disp_dp', label: 'DisplayPort working (if present)', deviceTypes: ['monitor'] },
{ id: 'disp_vga', label: 'VGA / DVI port working (if present)', deviceTypes: ['monitor'] },
{ id: 'disp_usbc', label: 'USB-C / Thunderbolt input working (if present)', deviceTypes: ['monitor'] },
{ id: 'disp_colours', label: 'Colour reproduction accurate — no discolouration or banding', deviceTypes: ['monitor'] },
{ id: 'disp_backlight', label: 'Backlight even — no dark spots or bleeding', deviceTypes: ['monitor'] },
{ id: 'disp_buttons', label: 'OSD / control buttons functional', deviceTypes: ['monitor'] },
{ id: 'disp_speakers', label: 'Built-in speakers working (if present)', deviceTypes: ['monitor'] },
]
},
{
id: 'power',
title: 'Power & Battery',
icon: '🔋',
iconBg: 'rgba(242,155,0,0.12)',
sectionDeviceTypes: NON_MONITOR,
items: [
{ id: 'pwr_onoff', label: 'Device powers on/off correctly', deviceTypes: NON_MONITOR },
{ id: 'pwr_charge', label: 'Charging port and charger working — charges to 100%', deviceTypes: ['laptop','tablet','phone'] },
{ id: 'pwr_health', label: 'Battery health within acceptable range', threshold: '≥ 80%', deviceTypes: ['laptop','tablet','phone'] },
{ id: 'pwr_drain', label: 'Battery holds charge under 30-min stress test — no abnormal drain', deviceTypes: ['laptop','tablet','phone'] },
{ id: 'pwr_heat', label: 'Device does not overheat and fans operate without excessive noise', deviceTypes: ['laptop','desktop','aio'] },
]
},
{
id: 'performance',
title: 'Performance & Connectivity',
icon: '⚡',
iconBg: 'rgba(46,125,50,0.12)',
sectionDeviceTypes: NON_MONITOR,
items: [
{ id: 'perf_boot', label: 'System boots to desktop smoothly', threshold: '< 60s', deviceTypes: NON_MONITOR },
{ id: 'perf_webcam', label: 'Webcam and microphone working', deviceTypes: ['laptop','tablet','phone','aio'] },
{ id: 'perf_speakers', label: 'Speakers produce clear sound without distortion', deviceTypes: NON_MONITOR },
{ id: 'perf_wifi', label: 'Wi-Fi connects and maintains stable connection', deviceTypes: NON_MONITOR },
{ id: 'perf_bluetooth', label: 'Bluetooth pairs and connects to device', deviceTypes: NON_MONITOR },
]
},
{
id: 'os',
title: 'Operating System',
icon: '💻',
iconBg: 'rgba(163,113,247,0.12)',
sectionDeviceTypes: NON_MONITOR,
items: [
{ id: 'os_boot', label: 'OS boots correctly without errors or blue screens', deviceTypes: NON_MONITOR },
{ id: 'os_updates', label: 'Latest OS updates and drivers installed', deviceTypes: NON_MONITOR },
{ id: 'os_reset', label: 'System restore / reset functionality verified', deviceTypes: NON_MONITOR },
{ id: 'os_activated', label: 'Operating system is activated (genuine license)', deviceTypes: NON_MONITOR },
]
},
{
id: 'functionality',
title: 'Ports & Functionality',
icon: '🔌',
iconBg: 'rgba(198,40,40,0.12)',
sectionDeviceTypes: NON_MONITOR,
items: [
{ id: 'func_usb', label: 'All USB ports detect and eject devices correctly', deviceTypes: ['laptop','desktop','aio'] },
{ id: 'func_audio', label: 'Headphone & microphone jack functional', deviceTypes: ['laptop','desktop','aio'] },
{ id: 'func_touch', label: 'Touch screen responsive and accurate', deviceTypes: ['tablet','phone'] },
{ id: 'func_fkeys', label: 'Function keys working (brightness, volume, etc.)', deviceTypes: ['laptop'] },
]
},
{
id: 'data',
title: 'Data Erasure',
icon: '🛡️',
iconBg: 'rgba(242,155,0,0.12)',
sectionDeviceTypes: NON_MONITOR,
items: [
{ id: 'data_wipe', label: 'Full data erasure completed', deviceTypes: NON_MONITOR },
]
},
{
id: 'final',
title: 'Final Checks',
icon: '✅',
iconBg: 'rgba(46,125,50,0.12)',
items: [
{ id: 'final_reset', label: 'Factory reset performed (clean OOBE state)', deviceTypes: NON_MONITOR },
{ id: 'final_clean', label: 'Device cleaned externally (screen, body, chassis)' },
],
hasTechNotes: true
}
];
// ── State ──
const state = {};
const comments = {};
let selectedGrade = null;
const techNotes = { cosmetic: '', os: '', specs: '', notes: '' };
function getDeviceType() {
return document.getElementById('deviceType').value;
}
function isSectionVisible(section) {
if (!section.sectionDeviceTypes) return true;
const dt = getDeviceType();
if (!dt) return true;
return section.sectionDeviceTypes.includes(dt);
}
function isItemVisible(item) {
if (!item.deviceTypes) return true;
const dt = getDeviceType();
if (!dt) return true;
return item.deviceTypes.includes(dt);
}
function getVisibleSections() {
return checklistData.filter(s => isSectionVisible(s));
}
function getAllVisibleItems() {
return getVisibleSections().flatMap(s => s.items.filter(i => isItemVisible(i)));
}
// ── Render ──
function render() {
const container = document.getElementById('sections');
container.innerHTML = '';
getVisibleSections().forEach(section => {
const visibleItems = section.items.filter(i => isItemVisible(i));
if (visibleItems.length === 0) return;
const answered = visibleItems.filter(i => state[i.id]).length;
const div = document.createElement('div');
div.className = 'section';
div.id = `section-${section.id}`;
div.innerHTML = `
<div class="section-header" onclick="toggleSection('${section.id}')">
<div class="section-icon" style="background:${section.iconBg}">${section.icon}</div>
<h2>${section.title}</h2>
<span class="section-count">${answered}/${visibleItems.length}</span>
<span class="section-chevron">▼</span>
</div>
<div class="section-body">
${visibleItems.map(item => renderItem(item)).join('')}
${section.hasGrade ? renderGradeSelector() : ''}
${section.hasTechNotes ? renderTechNotes() : ''}
</div>
`;
container.appendChild(div);
});
updateProgress();
const tnCos = document.getElementById('tn_cosmetic');
const tnOs = document.getElementById('tn_os');
const tnSpecs = document.getElementById('tn_specs');
const tnNotes = document.getElementById('tn_notes');
if (tnCos) tnCos.value = techNotes.cosmetic;
if (tnOs) tnOs.value = techNotes.os;
if (tnSpecs) tnSpecs.value = techNotes.specs;
if (tnNotes) tnNotes.value = techNotes.notes;
}
function renderItem(item) {
const currentState = state[item.id] || '';
const hasComment = comments[item.id] && comments[item.id].trim();
const statusClass = currentState ? `status-${currentState}` : '';
const thresholdHtml = item.threshold ? `<span class="threshold">${item.threshold}</span>` : '';
return `
<div class="check-item ${statusClass}" id="item-${item.id}">
<div class="check-label">${item.label}${thresholdHtml}</div>
<div class="check-actions">
<button class="btn-check ${currentState === 'pass' ? 'active-pass' : ''}" onclick="setStatus('${item.id}','pass')" title="Pass">✓</button>
<button class="btn-check ${currentState === 'fail' ? 'active-fail' : ''}" onclick="setStatus('${item.id}','fail')" title="Fail">✗</button>
<button class="btn-check ${currentState === 'na' ? 'active-na' : ''}" onclick="setStatus('${item.id}','na')" title="N/A">—</button>
</div>
<button class="comment-toggle ${hasComment ? 'has-comment' : ''}" onclick="toggleComment('${item.id}')" title="Add comment">💬</button>
</div>
<div class="comment-row" id="comment-${item.id}">
<textarea placeholder="Add a note..." oninput="setComment('${item.id}', this.value)">${comments[item.id] || ''}</textarea>
</div>
`;
}
function renderGradeSelector() {
const grades = [
{ letter: 'A', desc: 'Like New' },
{ letter: 'B', desc: 'Good — Minor Marks' },
{ letter: 'C', desc: 'Fair — Visible Wear' },
{ letter: 'D', desc: 'Poor — Heavy Wear' },
];
return `<div class="grade-selector">${grades.map(g => `
<button class="grade-btn ${selectedGrade === g.letter ? 'selected' : ''}" onclick="selectGrade('${g.letter}')">
<span class="grade-letter">${g.letter}</span>
<span class="grade-desc">${g.desc}</span>
</button>`).join('')}</div>`;
}
function renderTechNotes() {
return `
<div class="tech-notes-area">
<div class="tech-notes-grid">
<div class="tech-note-field">
<label>Cosmetic Issue Location</label>
<input type="text" id="tn_cosmetic" placeholder="e.g. Top-left lid corner" oninput="techNotes.cosmetic=this.value">
</div>
<div class="tech-note-field">
<label>OS Installed</label>
<input type="text" id="tn_os" placeholder="e.g. Win 11 Pro 23H2" oninput="techNotes.os=this.value">
</div>
<div class="tech-note-field full">
<label>Specifications</label>
<textarea id="tn_specs" placeholder="e.g. i5-8350U / 16GB DDR4 / 256GB NVMe / 14" FHD IPS" oninput="techNotes.specs=this.value"></textarea>
</div>
<div class="tech-note-field full">
<label>Additional Notes</label>
<textarea id="tn_notes" placeholder="Any other observations, issues, or context..." oninput="techNotes.notes=this.value"></textarea>
</div>
</div>
</div>`;
}
// ── Actions ──
function setStatus(id, value) {
state[id] = state[id] === value ? '' : value;
render();
}
function setComment(id, value) {
comments[id] = value;
const toggle = document.querySelector(`#item-${id} .comment-toggle`);
if (toggle) toggle.classList.toggle('has-comment', value.trim().length > 0);
}
function toggleComment(id) {
const row = document.getElementById(`comment-${id}`);
row.classList.toggle('visible');
if (row.classList.contains('visible')) row.querySelector('textarea').focus();
}
function toggleSection(id) {
document.getElementById(`section-${id}`).classList.toggle('collapsed');
}
function selectGrade(letter) {
selectedGrade = selectedGrade === letter ? null : letter;
render();
}
function handleDeviceType() { render(); }
function updateProgress() {
const allVisible = getAllVisibleItems();
const total = allVisible.length;
const passed = allVisible.filter(i => state[i.id] === 'pass').length;
const failed = allVisible.filter(i => state[i.id] === 'fail').length;
const na = allVisible.filter(i => state[i.id] === 'na').length;
const answered = passed + failed + na;
const pending = total - answered;
const pct = total > 0 ? Math.round((answered / total) * 100) : 0;
document.getElementById('progressPct').textContent = pct + '%';
document.getElementById('progressFill').style.width = pct + '%';
document.getElementById('countPass').textContent = passed;
document.getElementById('countFail').textContent = failed;
document.getElementById('countNa').textContent = na;
document.getElementById('countPending').textContent = pending;
document.getElementById('footPass').textContent = passed;
document.getElementById('footFail').textContent = failed;
const verdict = document.getElementById('footVerdict');
if (pending > 0) {
verdict.textContent = 'INCOMPLETE';
verdict.className = 'summary-verdict verdict-pending';
} else if (failed > 0) {
verdict.textContent = `FAIL — ${failed} issue${failed > 1 ? 's' : ''}`;
verdict.className = 'summary-verdict verdict-fail';
} else {
verdict.textContent = 'PASS ✓';
verdict.className = 'summary-verdict verdict-pass';
}
}
// ── Init ──
document.getElementById('testDate').valueAsDate = new Date();
render();
// ── Print ──
function printChecklist() {
const at = document.getElementById('atNumber').value || '—';
const date = document.getElementById('testDate').value || '—';
const tester = document.getElementById('testedBy').value || '—';
const deviceType = getDeviceType() || '—';
const allVisible = getAllVisibleItems();
const total = allVisible.length;
const passed = allVisible.filter(i => state[i.id] === 'pass').length;
const failed = allVisible.filter(i => state[i.id] === 'fail').length;
const na = allVisible.filter(i => state[i.id] === 'na').length;
const pending = total - passed - failed - na;
let verdictText = 'INCOMPLETE';
if (pending === 0 && failed > 0) verdictText = `FAIL — ${failed} issue${failed > 1 ? 's' : ''}`;
else if (pending === 0 && failed === 0) verdictText = 'PASS';
let sectionsHtml = '';
getVisibleSections().forEach(section => {
const visibleItems = section.items.filter(i => isItemVisible(i));
if (visibleItems.length === 0) return;
let rows = visibleItems.map(item => {
const s = state[item.id];
let statusLabel = '—', statusClass = 'pt-pending';
if (s === 'pass') { statusLabel = 'PASS'; statusClass = 'pt-pass'; }
else if (s === 'fail') { statusLabel = 'FAIL'; statusClass = 'pt-fail'; }
else if (s === 'na') { statusLabel = 'N/A'; statusClass = 'pt-na'; }
const comment = comments[item.id] ? `<div class="pt-comment">${comments[item.id]}</div>` : '';
return `<tr><td>${item.label}</td><td class="pt-status ${statusClass}">${statusLabel}</td><td>${comment}</td></tr>`;
}).join('');
let gradeHtml = '';
if (section.hasGrade) {
gradeHtml = `<div style="padding:2px 8px;font-size:11px;">Cosmetic Grade: ${selectedGrade ? `<span class="print-grade">${selectedGrade}</span>` : '<span style="color:#999">Not set</span>'}</div>`;
}
let notesHtml = '';
if (section.hasTechNotes) {
notesHtml = `
<div class="print-notes-section">
<div class="print-notes-grid">
<div class="print-note-item"><div class="pn-label">Cosmetic Issue Location</div><div class="pn-value">${techNotes.cosmetic || ''}</div></div>
<div class="print-note-item"><div class="pn-label">OS Installed</div><div class="pn-value">${techNotes.os || ''}</div></div>
</div>
<div class="print-notes-grid full-width" style="margin-top:4px;">
<div class="print-note-item"><div class="pn-label">Specifications</div><div class="pn-value">${techNotes.specs || ''}</div></div>
<div class="print-note-item"><div class="pn-label">Additional Notes</div><div class="pn-value">${techNotes.notes || ''}</div></div>
</div>
</div>`;
}
sectionsHtml += `
<div class="print-section">
<div class="print-section-title">${section.icon} ${section.title}</div>
<table class="print-table">
<thead><tr><th>Checkpoint</th><th>Status</th><th>Comments</th></tr></thead>
<tbody>${rows}</tbody>
</table>
${gradeHtml}
${notesHtml}
</div>`;
});
document.getElementById('printOverlay').innerHTML = `
<div class="print-header">
<div style="display:flex;align-items:center;gap:10px;">
<div class="print-logo">✓</div>
<h1>Device Testing Checklist</h1>
</div>
<div style="font-size:10px;color:#666;">Printed ${new Date().toLocaleDateString('en-GB')} ${new Date().toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}</div>
</div>
<div class="print-meta">
<div class="print-meta-item"><span class="pm-label">Asset Tag</span><span class="pm-value">${at}</span></div>
<div class="print-meta-item"><span class="pm-label">Date of Testing</span><span class="pm-value">${date}</span></div>
<div class="print-meta-item"><span class="pm-label">Tested By</span><span class="pm-value">${tester}</span></div>
<div class="print-meta-item"><span class="pm-label">Device Type</span><span class="pm-value">${deviceType}</span></div>
</div>
<div class="print-verdict-bar">
<div class="pv-stats">
<span>Pass: ${passed}</span>
<span>Fail: ${failed}</span>
<span>N/A: ${na}</span>
<span>Pending: ${pending}</span>
</div>
<div class="pv-verdict">${verdictText}</div>
</div>
${sectionsHtml}
<div class="print-footer">
<span>Device Testing Checklist</span>
<span>Page 1</span>
</div>`;
window.print();
}
</script>
</body>
</html>