@@ -10,7 +10,7 @@ import { columnBodyRenderer } from '@vaadin/grid/lit.js';
10
10
import { gridRowDetailsRenderer } from '@vaadin/grid/lit.js' ;
11
11
import '@vaadin/progress-bar' ;
12
12
import '@vaadin/checkbox' ;
13
- import 'echarts-pie ' ;
13
+ import 'echarts-horizontal-stacked-bar ' ;
14
14
15
15
/**
16
16
* This component shows the Continuous Testing Page
@@ -26,13 +26,11 @@ export class QwcContinuousTesting extends QwcHotReloadElement {
26
26
}
27
27
.menubar{
28
28
border-bottom: 1px solid var(--lumo-contrast-5pct);
29
- }
30
- .center {
31
- width: 100%;
32
29
display: flex;
33
- gap: 10px ;
34
- flex-direction: column ;
30
+ align-items: center ;
31
+ justify-content: space-between ;
35
32
}
33
+
36
34
.results {
37
35
display: flex;
38
36
gap: 10px;
@@ -55,29 +53,19 @@ export class QwcContinuousTesting extends QwcHotReloadElement {
55
53
display: flex;
56
54
flex-direction: column;
57
55
overflow: hidden;
58
- margin-left: 10px ;
56
+ margin-left: 40px ;
59
57
margin-top: 10px;
60
- }
61
- vaadin-button {
62
- cursor: pointer;
58
+ height: 100%;
63
59
}
64
60
65
- .logDetails {
66
- background: var(--lumo-contrast-5pct);
67
- overflow: hidden;
68
- margin-right: 5px;
69
- margin-left: 5px;
70
- border-radius: 15px 15px 0px 0px;
71
- display: flex;
72
- flex-direction: column;
61
+ .progress {
62
+ padding-right: 20px;
63
+ width: 50%;
73
64
}
74
- .rightSideInfo {
75
- display: flex;
76
- flex-direction: column;
77
- }
78
- echarts-pie {
79
- width: 400px;
80
- height: 400px;
65
+
66
+ .total {
67
+ padding-right: 20px;
68
+ text-align: center;
81
69
}
82
70
` ;
83
71
@@ -142,20 +130,21 @@ export class QwcContinuousTesting extends QwcHotReloadElement {
142
130
render ( ) {
143
131
return html `
144
132
${ this . _renderMenuBar ( ) }
145
- < div class ="results ">
146
- ${ this . _renderResultSet ( ) }
147
- ${ this . _renderState ( ) }
148
- </ div >
133
+ ${ this . _renderResultSet ( ) }
134
+ ${ this . _renderBarChart ( ) }
149
135
` ;
150
136
}
151
137
152
138
_renderMenuBar ( ) {
153
139
if ( this . _state ) {
154
140
return html `< div class ="menubar ">
155
- ${ this . _renderStopStartButton ( ) }
156
- ${ this . _renderRunAllButton ( ) }
157
- ${ this . _renderRunFailedButton ( ) }
158
- ${ this . _renderToggleBrokenOnly ( ) }
141
+ < div >
142
+ ${ this . _renderStopStartButton ( ) }
143
+ ${ this . _renderRunAllButton ( ) }
144
+ ${ this . _renderRunFailedButton ( ) }
145
+ ${ this . _renderToggleBrokenOnly ( ) }
146
+ </ div >
147
+ ${ this . _renderBusyIndicator ( ) }
159
148
</ div > ` ;
160
149
} else {
161
150
return html `< div class ="menubar ">
@@ -164,19 +153,19 @@ export class QwcContinuousTesting extends QwcHotReloadElement {
164
153
}
165
154
}
166
155
167
- _renderState ( ) {
156
+ _renderBarChart ( ) {
168
157
if ( this . _state && this . _state . running && this . _state . run > 0 ) {
169
- return html ` < div class =" rightSideInfo " >
170
- ${ this . _renderStateChart ( ) }
171
- ${ this . _renderBusyIndicator ( ) }
172
- </ div > ` ;
173
- } else if ( this . _state && this . _state . running && this . _state . run === 0 ) {
174
- return html ` ${ this . _renderProgressBar ( "Starting ..." ) } `;
158
+ let values = [ this . _state . passed , this . _state . failed , this . _state . skipped ] ;
159
+ return html ` < echarts-horizontal-stacked-bar name = " Tests "
160
+ sectionTitles =" ${ this . _chartTitles . toString ( ) } "
161
+ sectionValues =" ${ values . toString ( ) } "
162
+ sectionColors =" ${ this . _chartColors . toString ( ) } " >
163
+ </ echarts-horizontal-stacked-bar > ` ;
175
164
}
176
165
}
177
166
178
167
_renderStateChart ( ) {
179
- let values = [ this . _state . passed , this . _state . failed , this . _state . skipped ]
168
+ let values = [ this . _state . passed , this . _state . failed , this . _state . skipped ] ;
180
169
return html `< echarts-pie name = "Tests "
181
170
sectionTitles ="${ this . _chartTitles . toString ( ) } "
182
171
sectionValues ="${ values . toString ( ) } "
@@ -186,13 +175,13 @@ export class QwcContinuousTesting extends QwcHotReloadElement {
186
175
187
176
_renderBusyIndicator ( ) {
188
177
if ( this . _state && this . _state . inProgress ) {
189
- return html `${ this . _renderProgressBar ( "Running ..." ) } ` ;
190
- } else if ( this . _results ) {
178
+ return html `< vaadin-progress-bar class =" progress " indeterminate > </ vaadin-progress-bar > ` ;
179
+ } else if ( this . _results && this . _state && this . _state . running ) {
191
180
192
- return html `< span style =" text-align: center; ">
193
- Total time:
194
- < qui-badge > < span > ${ this . _results . totalTime } ms</ span > </ qui-badge >
195
- </ span > `
181
+ return html `< span class =" total ">
182
+ Total time:
183
+ < qui-badge > < span > ${ this . _results . totalTime } ms</ span > </ qui-badge >
184
+ </ span > `
196
185
}
197
186
198
187
}
@@ -206,9 +195,7 @@ export class QwcContinuousTesting extends QwcHotReloadElement {
206
195
207
196
var allResults = failingResults . concat ( passingResults , skippedResults ) ;
208
197
209
- return html `< div class ="center ">
210
- ${ this . _renderResults ( allResults ) }
211
- </ div > ` ;
198
+ return html `${ this . _renderResults ( allResults ) } ` ;
212
199
}
213
200
214
201
}
@@ -410,14 +397,5 @@ export class QwcContinuousTesting extends QwcHotReloadElement {
410
397
this . _busy = false ;
411
398
} ) ;
412
399
}
413
-
414
- _renderProgressBar ( message ) {
415
- return html `
416
- < div style ="color: var(--lumo-secondary-text-color);width: 95%; " >
417
- < div > ${ message } </ div >
418
- < vaadin-progress-bar indeterminate > </ vaadin-progress-bar >
419
- </ div >
420
- ` ;
421
- }
422
400
}
423
401
customElements . define ( 'qwc-continuous-testing' , QwcContinuousTesting ) ;
0 commit comments