@@ -82,7 +82,7 @@ export class ProjectViewComponent implements OnInit {
82
82
83
83
this . project = ( await this . projectService . getProjects ( this . project ) . toPromise ( ) ) [ 0 ] ;
84
84
85
- [ this . allIssues , this . suites , this . testRuns , this . testRunStats ] = await Promise . all ( [
85
+ [ this . allIssues , this . suites , this . testRuns , this . testRunStats ] = await Promise . all ( [
86
86
this . issueService . getIssues ( { project_id : projectId } ) ,
87
87
this . testSuiteService . getTestSuite ( { project_id : projectId } ) ,
88
88
this . testrunService . getTestRun ( this . testRun , 5 ) ,
@@ -175,17 +175,21 @@ export class ProjectViewComponent implements OnInit {
175
175
calculateAutomationQuality ( testRunStatsBySuites : { suite : TestSuite , stats : TestRunStat [ ] } [ ] ) : { quality : number , NA : number , testIssue : number , other : number , appIssue : number , passed : number , total : number } {
176
176
let stat = { quality : 0 , NA : 0 , testIssue : 0 , other : 0 , appIssue : 0 , passed : 0 , total : 0 }
177
177
178
+ console . log ( testRunStatsBySuites )
179
+
178
180
for ( const suiteStat of testRunStatsBySuites ) {
179
181
if ( suiteStat . stats [ 0 ] ) {
180
- stat . NA += suiteStat . stats [ 0 ] . not_assigned ;
181
- stat . appIssue += suiteStat . stats [ 0 ] . app_issue ;
182
- stat . passed += suiteStat . stats [ 0 ] . passed ;
183
- stat . testIssue += suiteStat . stats [ 0 ] . warning ;
184
- stat . other += suiteStat . stats [ 0 ] . other ;
185
- stat . total += suiteStat . stats [ 0 ] . total ;
182
+ stat . NA += suiteStat . stats [ 0 ] . not_assigned ? suiteStat . stats [ 0 ] . not_assigned : 0 ;
183
+ stat . appIssue += suiteStat . stats [ 0 ] . app_issue ? suiteStat . stats [ 0 ] . app_issue : 0 ;
184
+ stat . passed += suiteStat . stats [ 0 ] . passed ? suiteStat . stats [ 0 ] . passed : 0 ;
185
+ stat . testIssue += suiteStat . stats [ 0 ] . warning ? suiteStat . stats [ 0 ] . warning : 0 ;
186
+ stat . other += suiteStat . stats [ 0 ] . other ? suiteStat . stats [ 0 ] . other : 0 ;
187
+ stat . total += suiteStat . stats [ 0 ] . total ? suiteStat . stats [ 0 ] . total : 0 ;
186
188
}
187
189
}
188
190
191
+ console . log ( stat )
192
+
189
193
stat . quality = stat . total > 0 ? ( 1 - ( ( stat . NA * 1 + stat . testIssue * 0.75 + stat . other * 0.5 ) / ( stat . total ) ) ) * 100 : 0 ;
190
194
if ( stat . quality < 0 ) {
191
195
stat . quality = 0 ;
@@ -204,10 +208,10 @@ export class ProjectViewComponent implements OnInit {
204
208
for ( const suiteStat of testRunStatsBySuite ) {
205
209
for ( const stat of suiteStat . stats ) {
206
210
if ( Math . floor ( new Date ( ) . getTime ( ) - new Date ( stat . finish_time ) . getTime ( ) ) / ( 1000 * 60 * 60 * 24 ) < 90 ) {
207
- ttlNA += stat . not_assigned ;
208
- ttltestIssue += stat . warning ;
209
- ttlOther += stat . other ;
210
- ttl += stat . total ;
211
+ ttlNA += stat . not_assigned ? stat . not_assigned : 0 ;
212
+ ttltestIssue += stat . warning ? stat . warning : 0 ;
213
+ ttlOther += stat . other ? stat . other : 0 ;
214
+ ttl += stat . total ? stat . total : 0 ;
211
215
}
212
216
}
213
217
}
@@ -220,6 +224,7 @@ export class ProjectViewComponent implements OnInit {
220
224
}
221
225
222
226
createChartData ( data : { quality : number , NA : number , testIssue : number , other : number , appIssue : number , passed : number } ) {
227
+ console . log ( data ) ;
223
228
return [ {
224
229
value : data . passed ,
225
230
color : '#28A745' ,
0 commit comments