Spaces:
Paused
Paused
Create test.component.html
Browse files
flare-ui/src/app/components/test/test.component.html
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div class="test-container">
|
| 2 |
+
<h2>System Tests</h2>
|
| 3 |
+
|
| 4 |
+
<div class="test-controls">
|
| 5 |
+
<button mat-raised-button color="primary" (click)="runAllTests()" [disabled]="running">
|
| 6 |
+
<mat-icon>play_arrow</mat-icon>
|
| 7 |
+
Run All Tests
|
| 8 |
+
</button>
|
| 9 |
+
<button mat-raised-button (click)="runSelectedTests()"
|
| 10 |
+
[disabled]="running || selectedTests.length === 0">
|
| 11 |
+
<mat-icon>play_circle_outline</mat-icon>
|
| 12 |
+
Run Selected ({{ selectedTests.length }})
|
| 13 |
+
</button>
|
| 14 |
+
<button mat-raised-button color="warn" (click)="stopTests()" [disabled]="!running">
|
| 15 |
+
<mat-icon>stop</mat-icon>
|
| 16 |
+
Stop
|
| 17 |
+
</button>
|
| 18 |
+
</div>
|
| 19 |
+
|
| 20 |
+
<div class="test-categories">
|
| 21 |
+
<mat-checkbox [(ngModel)]="allSelected" (change)="toggleAll()">
|
| 22 |
+
<strong>All Tests ({{ totalTests }} tests)</strong>
|
| 23 |
+
</mat-checkbox>
|
| 24 |
+
|
| 25 |
+
<mat-accordion>
|
| 26 |
+
<mat-expansion-panel *ngFor="let category of categories"
|
| 27 |
+
[(expanded)]="category.expanded">
|
| 28 |
+
<mat-expansion-panel-header>
|
| 29 |
+
<mat-panel-title>
|
| 30 |
+
<mat-checkbox [(ngModel)]="category.selected"
|
| 31 |
+
(click)="$event.stopPropagation()">
|
| 32 |
+
{{ category.displayName }}
|
| 33 |
+
</mat-checkbox>
|
| 34 |
+
</mat-panel-title>
|
| 35 |
+
<mat-panel-description>
|
| 36 |
+
<div class="category-status" *ngIf="getCategoryResults(category).total > 0">
|
| 37 |
+
<mat-chip-listbox>
|
| 38 |
+
<mat-chip-option *ngIf="getCategoryResults(category).passed > 0"
|
| 39 |
+
class="success-chip">
|
| 40 |
+
{{ getCategoryResults(category).passed }} passed
|
| 41 |
+
</mat-chip-option>
|
| 42 |
+
<mat-chip-option *ngIf="getCategoryResults(category).failed > 0"
|
| 43 |
+
class="error-chip">
|
| 44 |
+
{{ getCategoryResults(category).failed }} failed
|
| 45 |
+
</mat-chip-option>
|
| 46 |
+
</mat-chip-listbox>
|
| 47 |
+
</div>
|
| 48 |
+
</mat-panel-description>
|
| 49 |
+
</mat-expansion-panel-header>
|
| 50 |
+
|
| 51 |
+
<mat-list>
|
| 52 |
+
<mat-list-item *ngFor="let test of category.tests">
|
| 53 |
+
<mat-icon matListItemIcon [class]="'status-' + (getTestResult(test.name)?.status || 'pending')">
|
| 54 |
+
{{ getTestResult(test.name)?.status === 'PASS' ? 'check_circle' :
|
| 55 |
+
getTestResult(test.name)?.status === 'FAIL' ? 'cancel' :
|
| 56 |
+
getTestResult(test.name)?.status === 'RUNNING' ? 'hourglass_empty' :
|
| 57 |
+
'radio_button_unchecked' }}
|
| 58 |
+
</mat-icon>
|
| 59 |
+
<div matListItemTitle>{{ test.name }}</div>
|
| 60 |
+
<div matListItemLine *ngIf="getTestResult(test.name)">
|
| 61 |
+
<span class="test-duration" *ngIf="getTestResult(test.name)?.duration_ms">
|
| 62 |
+
{{ getTestResult(test.name)?.duration_ms }}ms
|
| 63 |
+
</span>
|
| 64 |
+
<span class="test-details" *ngIf="getTestResult(test.name)?.details">
|
| 65 |
+
• {{ getTestResult(test.name)?.details }}
|
| 66 |
+
</span>
|
| 67 |
+
<span class="test-error" *ngIf="getTestResult(test.name)?.error">
|
| 68 |
+
• {{ getTestResult(test.name)?.error }}
|
| 69 |
+
</span>
|
| 70 |
+
</div>
|
| 71 |
+
<mat-icon matListItemMeta *ngIf="currentTest === test.name" class="running-icon">
|
| 72 |
+
sync
|
| 73 |
+
</mat-icon>
|
| 74 |
+
</mat-list-item>
|
| 75 |
+
</mat-list>
|
| 76 |
+
</mat-expansion-panel>
|
| 77 |
+
</mat-accordion>
|
| 78 |
+
</div>
|
| 79 |
+
|
| 80 |
+
<div class="test-results" *ngIf="testResults.length > 0 || running">
|
| 81 |
+
<h3>Test Progress</h3>
|
| 82 |
+
|
| 83 |
+
<mat-progress-bar [value]="progress"
|
| 84 |
+
[mode]="running ? 'determinate' : 'determinate'"
|
| 85 |
+
[color]="failedTests > 0 ? 'warn' : 'primary'">
|
| 86 |
+
</mat-progress-bar>
|
| 87 |
+
|
| 88 |
+
<div class="test-summary">
|
| 89 |
+
<div class="summary-item">
|
| 90 |
+
<mat-icon class="success">check_circle</mat-icon>
|
| 91 |
+
<span>Passed: {{ passedTests }}</span>
|
| 92 |
+
</div>
|
| 93 |
+
<div class="summary-item">
|
| 94 |
+
<mat-icon class="error">cancel</mat-icon>
|
| 95 |
+
<span>Failed: {{ failedTests }}</span>
|
| 96 |
+
</div>
|
| 97 |
+
<div class="summary-item">
|
| 98 |
+
<mat-icon>timer</mat-icon>
|
| 99 |
+
<span>Total: {{ testResults.length }}/{{ selectedTests.length }}</span>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<div class="current-test" *ngIf="currentTest">
|
| 104 |
+
<mat-icon class="spin">sync</mat-icon>
|
| 105 |
+
Running: {{ currentTest }}
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
|
| 109 |
+
<div class="empty-state" *ngIf="!running && testResults.length === 0">
|
| 110 |
+
<mat-icon>assignment_turned_in</mat-icon>
|
| 111 |
+
<p>No test results yet. Select tests and click "Run Selected" to start.</p>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|