ShadowWolf1999 commited on
Commit
a15e7fd
·
verified ·
1 Parent(s): b35b6d0

还可以再进一步的美化吗 比如这个FSD 是在哪个项目 或者关联了哪个模块。 也就是有关联性。 另外一个case 是可以即给sit使用也给UAT 使用的

Browse files
Files changed (2) hide show
  1. components/testcase-dashboard.js +68 -38
  2. style.css +24 -45
components/testcase-dashboard.js CHANGED
@@ -107,8 +107,17 @@ class TestcaseDashboard extends HTMLElement {
107
  border-top: 1px solid var(--jira-border);
108
  background: rgba(244, 245, 247, 0.5);
109
  }
 
 
 
 
 
 
 
 
 
110
 
111
- .fsd-badge {
112
  background: #EAE6FF;
113
  color: #403294;
114
  padding: 0.25rem 0.5rem;
@@ -118,13 +127,23 @@ class TestcaseDashboard extends HTMLElement {
118
  margin-right: 0.5rem;
119
  }
120
 
121
- .user-story-badge {
122
  background: #E3FCEF;
123
  color: #006644;
124
  padding: 0.25rem 0.5rem;
125
  border-radius: 3px;
126
  font-size: 0.75rem;
127
  font-weight: 500;
 
 
 
 
 
 
 
 
 
 
128
  }
129
 
130
  .priority-badge {
@@ -270,30 +289,26 @@ class TestcaseDashboard extends HTMLElement {
270
  <main>
271
  <div class="filter-bar">
272
  <input type="text" class="search-input" placeholder="Search test cases...">
273
-
274
- <select class="filter-btn">
275
- <option>All Stages</option>
276
- <option>SIT</option>
277
- <option>UAT</option>
278
- <option>PVT</option>
279
  </select>
280
-
281
- <select class="filter-btn">
282
- <option>All Types</option>
283
- <option>Manual</option>
284
- <option>UI Auto</option>
285
- <option>API Auto</option>
286
  </select>
287
-
288
- <select class="filter-btn">
289
- <option>All Statuses</option>
290
- <option>Passed</option>
291
- <option>Failed</option>
292
- <option>Pending</option>
293
  </select>
294
-
295
- <button class="filter-btn active">Clear Filters</button>
296
- </div>
297
 
298
  <div class="testcase-list">
299
  ${this.generateTestCases()}
@@ -343,11 +358,13 @@ class TestcaseDashboard extends HTMLElement {
343
  title: 'User authentication validation',
344
  type: 'Manual',
345
  status: 'Passed',
346
- stage: 'SIT',
347
  priority: 'High',
 
 
348
  fsd: 'FSD-101',
349
  userStory: 'US-42',
350
- description: 'Validate user can authenticate with valid credentials',
351
  steps: '1. Navigate to login page\n2. Enter valid credentials\n3. Click login button',
352
  expected: 'User should be authenticated and redirected to dashboard'
353
  },
@@ -356,11 +373,13 @@ class TestcaseDashboard extends HTMLElement {
356
  title: 'API endpoint response validation',
357
  type: 'API Auto',
358
  status: 'Failed',
359
- stage: 'UAT',
360
  priority: 'Medium',
 
 
361
  fsd: 'FSD-102',
362
  userStory: 'US-43',
363
- description: 'Validate API returns correct response format',
364
  steps: '1. Send GET request to /api/users\n2. Verify response format',
365
  expected: 'Response should match OpenAPI specification'
366
  },
@@ -369,11 +388,13 @@ class TestcaseDashboard extends HTMLElement {
369
  title: 'UI component rendering test',
370
  type: 'UI Auto',
371
  status: 'Pending',
372
- stage: 'PVT',
373
  priority: 'Low',
 
 
374
  fsd: 'FSD-103',
375
  userStory: 'US-44',
376
- description: 'Verify dashboard components render correctly',
377
  steps: '1. Load dashboard page\n2. Check all components',
378
  expected: 'All components should render without errors'
379
  },
@@ -382,11 +403,13 @@ class TestcaseDashboard extends HTMLElement {
382
  title: 'Performance benchmark',
383
  type: 'Performance',
384
  status: 'Passed',
385
- stage: 'SIT',
386
  priority: 'Medium',
 
 
387
  fsd: 'FSD-104',
388
  userStory: 'US-45',
389
- description: 'Measure API response times under load',
390
  steps: '1. Run load test with 1000 concurrent users\n2. Record response times',
391
  expected: '95% of requests should complete in <500ms'
392
  },
@@ -395,11 +418,13 @@ class TestcaseDashboard extends HTMLElement {
395
  title: 'Security vulnerability scan',
396
  type: 'Security',
397
  status: 'Failed',
398
- stage: 'UAT',
399
  priority: 'High',
 
 
400
  fsd: 'FSD-105',
401
  userStory: 'US-46',
402
- description: 'Check for common security vulnerabilities',
403
  steps: '1. Run OWASP ZAP scan\n2. Analyze results',
404
  expected: 'No critical vulnerabilities found'
405
  }
@@ -408,9 +433,11 @@ return testCases.map(tc => `
408
  <div class="testcase-card" data-id="${tc.id}">
409
  <div class="status-indicator status-${tc.status.toLowerCase()}"></div>
410
  <div class="testcase-card-header">
 
 
411
  <span class="fsd-badge">${tc.fsd}</span>
412
  <span class="user-story-badge">${tc.userStory}</span>
413
- <button class="edit-btn ml-auto" onclick="this.closest('.testcase-card').classList.toggle('expanded')">
414
  Edit
415
  </button>
416
  </div>
@@ -421,8 +448,8 @@ return testCases.map(tc => `
421
  </div>
422
  <div>
423
  <div class="font-medium">${tc.title}</div>
424
- <div class="text-sm text-gray-600">${tc.id} • ${tc.stage}</div>
425
- </div>
426
  <div class="ml-auto">
427
  <span class="priority-badge priority-${tc.priority.toLowerCase()}">${tc.priority}</span>
428
  </div>
@@ -434,8 +461,11 @@ return testCases.map(tc => `
434
  </div>
435
  </div>
436
  <div class="testcase-card-footer">
437
- <div class="text-xs text-gray-500">Last updated: ${new Date().toLocaleDateString()}</div>
438
- <div class="flex gap-2">
 
 
 
439
  <button class="edit-btn">Comment</button>
440
  <button class="edit-btn">Attach</button>
441
  <button class="edit-btn">Clone</button>
 
107
  border-top: 1px solid var(--jira-border);
108
  background: rgba(244, 245, 247, 0.5);
109
  }
110
+ .project-badge {
111
+ background: #DEEBFF;
112
+ color: #0747A6;
113
+ padding: 0.25rem 0.5rem;
114
+ border-radius: 3px;
115
+ font-size: 0.75rem;
116
+ font-weight: 500;
117
+ margin-right: 0.5rem;
118
+ }
119
 
120
+ .module-badge {
121
  background: #EAE6FF;
122
  color: #403294;
123
  padding: 0.25rem 0.5rem;
 
127
  margin-right: 0.5rem;
128
  }
129
 
130
+ .fsd-badge {
131
  background: #E3FCEF;
132
  color: #006644;
133
  padding: 0.25rem 0.5rem;
134
  border-radius: 3px;
135
  font-size: 0.75rem;
136
  font-weight: 500;
137
+ margin-right: 0.5rem;
138
+ }
139
+
140
+ .user-story-badge {
141
+ background: #E3FCEF;
142
+ color: #006644;
143
+ padding: 0.25rem 0.5rem;
144
+ border-radius: 3px;
145
+ font-size: 0.75rem;
146
+ font-weight: 500;
147
  }
148
 
149
  .priority-badge {
 
289
  <main>
290
  <div class="filter-bar">
291
  <input type="text" class="search-input" placeholder="Search test cases...">
292
+ <select class="filter-btn" multiple>
293
+ <option value="SIT">SIT</option>
294
+ <option value="UAT">UAT</option>
295
+ <option value="PVT">PVT</option>
 
 
296
  </select>
297
+ <select class="filter-btn" multiple>
298
+ <option value="Manual">Manual</option>
299
+ <option value="UI Auto">UI Auto</option>
300
+ <option value="API Auto">API Auto</option>
301
+ <option value="Performance">Performance</option>
302
+ <option value="Security">Security</option>
303
  </select>
304
+ <select class="filter-btn" multiple>
305
+ <option value="Passed">Passed</option>
306
+ <option value="Failed">Failed</option>
307
+ <option value="Pending">Pending</option>
 
 
308
  </select>
309
+ <button class="filter-btn active" id="clear-filters">Clear Filters</button>
310
+ <button class="filter-btn" id="save-filters">Save Filter Preset</button>
311
+ </div>
312
 
313
  <div class="testcase-list">
314
  ${this.generateTestCases()}
 
358
  title: 'User authentication validation',
359
  type: 'Manual',
360
  status: 'Passed',
361
+ stages: ['SIT', 'UAT'],
362
  priority: 'High',
363
+ project: 'PROJ-1',
364
+ module: 'AUTH-MOD',
365
  fsd: 'FSD-101',
366
  userStory: 'US-42',
367
+ description: 'Validate user can authenticate with valid credentials',
368
  steps: '1. Navigate to login page\n2. Enter valid credentials\n3. Click login button',
369
  expected: 'User should be authenticated and redirected to dashboard'
370
  },
 
373
  title: 'API endpoint response validation',
374
  type: 'API Auto',
375
  status: 'Failed',
376
+ stages: ['UAT', 'PVT'],
377
  priority: 'Medium',
378
+ project: 'PROJ-1',
379
+ module: 'API-MOD',
380
  fsd: 'FSD-102',
381
  userStory: 'US-43',
382
+ description: 'Validate API returns correct response format',
383
  steps: '1. Send GET request to /api/users\n2. Verify response format',
384
  expected: 'Response should match OpenAPI specification'
385
  },
 
388
  title: 'UI component rendering test',
389
  type: 'UI Auto',
390
  status: 'Pending',
391
+ stages: ['SIT', 'UAT', 'PVT'],
392
  priority: 'Low',
393
+ project: 'PROJ-2',
394
+ module: 'UI-MOD',
395
  fsd: 'FSD-103',
396
  userStory: 'US-44',
397
+ description: 'Verify dashboard components render correctly',
398
  steps: '1. Load dashboard page\n2. Check all components',
399
  expected: 'All components should render without errors'
400
  },
 
403
  title: 'Performance benchmark',
404
  type: 'Performance',
405
  status: 'Passed',
406
+ stages: ['SIT'],
407
  priority: 'Medium',
408
+ project: 'PROJ-2',
409
+ module: 'PERF-MOD',
410
  fsd: 'FSD-104',
411
  userStory: 'US-45',
412
+ description: 'Measure API response times under load',
413
  steps: '1. Run load test with 1000 concurrent users\n2. Record response times',
414
  expected: '95% of requests should complete in <500ms'
415
  },
 
418
  title: 'Security vulnerability scan',
419
  type: 'Security',
420
  status: 'Failed',
421
+ stages: ['UAT', 'PVT'],
422
  priority: 'High',
423
+ project: 'PROJ-3',
424
+ module: 'SEC-MOD',
425
  fsd: 'FSD-105',
426
  userStory: 'US-46',
427
+ description: 'Check for common security vulnerabilities',
428
  steps: '1. Run OWASP ZAP scan\n2. Analyze results',
429
  expected: 'No critical vulnerabilities found'
430
  }
 
433
  <div class="testcase-card" data-id="${tc.id}">
434
  <div class="status-indicator status-${tc.status.toLowerCase()}"></div>
435
  <div class="testcase-card-header">
436
+ <span class="project-badge">${tc.project}</span>
437
+ <span class="module-badge">${tc.module}</span>
438
  <span class="fsd-badge">${tc.fsd}</span>
439
  <span class="user-story-badge">${tc.userStory}</span>
440
+ <button class="edit-btn ml-auto" onclick="this.closest('.testcase-card').classList.toggle('expanded')">
441
  Edit
442
  </button>
443
  </div>
 
448
  </div>
449
  <div>
450
  <div class="font-medium">${tc.title}</div>
451
+ <div class="text-sm text-gray-600">${tc.id} • ${tc.stages.join(', ')}</div>
452
+ </div>
453
  <div class="ml-auto">
454
  <span class="priority-badge priority-${tc.priority.toLowerCase()}">${tc.priority}</span>
455
  </div>
 
461
  </div>
462
  </div>
463
  <div class="testcase-card-footer">
464
+ <div class="text-xs text-gray-500">
465
+ Last updated: ${new Date().toLocaleDateString()} •
466
+ Used in: ${tc.stages.map(s => `<span class="stage-tag">${s}</span>`).join(' ')}
467
+ </div>
468
+ <div class="flex gap-2">
469
  <button class="edit-btn">Comment</button>
470
  <button class="edit-btn">Attach</button>
471
  <button class="edit-btn">Clone</button>
style.css CHANGED
@@ -1,53 +1,32 @@
1
-
2
- /* Base styles that will apply to the whole document */
3
- body {
4
- margin: 0;
5
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
6
- 'Helvetica Neue', Arial, sans-serif;
7
- line-height: 1.5;
8
- }
9
-
10
- /* Utility classes */
11
- .flex {
12
- display: flex;
13
- }
14
-
15
- .items-center {
16
- align-items: center;
17
- }
18
-
19
- .justify-between {
20
- justify-content: space-between;
21
  }
22
 
23
- .ml-auto {
24
- margin-left: auto;
 
 
 
 
25
  }
26
 
27
- .text-green-600 {
28
- color: #00875A;
 
 
29
  }
30
 
31
- .text-red-600 {
32
- color: #DE350B;
33
  }
34
- .text-yellow-600 {
35
- color: #FF991F;
36
- }
37
-
38
- .mt-1 { margin-top: 0.25rem; }
39
- .mt-2 { margin-top: 0.5rem; }
40
- .mt-3 { margin-top: 0.75rem; }
41
- .mt-4 { margin-top: 1rem; }
42
- .mb-2 { margin-bottom: 0.5rem; }
43
 
44
- .gap-2 { gap: 0.5rem; }
45
-
46
- pre {
47
- white-space: pre-wrap;
48
- font-family: inherit;
49
- margin: 0.5rem 0;
50
- padding: 0.5rem;
51
- background: rgba(9,30,66,0.04);
52
- border-radius: 3px;
53
- }
 
1
+ .stage-tag {
2
+ display: inline-block;
3
+ padding: 0.1rem 0.3rem;
4
+ border-radius: 3px;
5
+ background: rgba(9,30,66,0.08);
6
+ margin: 0 0.1rem;
7
+ font-size: 0.7rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  }
9
 
10
+ select[multiple] {
11
+ min-width: 120px;
12
+ height: auto;
13
+ padding: 0.25rem;
14
+ border-radius: 4px;
15
+ border: 1px solid var(--jira-border);
16
  }
17
 
18
+ select[multiple] option {
19
+ padding: 0.25rem 0.5rem;
20
+ margin: 0.1rem 0;
21
+ border-radius: 3px;
22
  }
23
 
24
+ select[multiple] option:hover {
25
+ background: rgba(9,30,66,0.08);
26
  }
 
 
 
 
 
 
 
 
 
27
 
28
+ select[multiple] option:checked {
29
+ background: #DEEBFF;
30
+ color: var(--jira-blue);
31
+ font-weight: 500;
32
+ }