2014-09-09 1 views
0

테스트 세트의 실행 상태를 반복 및 릴리스하여 표시하고 진행률 표시 줄 (품질 테스트 계획 페이지의 것과 비슷 함) 또는 원형 차트를 표시하고 싶습니다. (반복 대시 보드 앱과 유사) 테스트 세트 내의 테스트 케이스에 대한 결과를 표시합니다. 이 일을하기 위해 이미 존재하는 것이 있습니까? 어떤 도움을 주셔서 감사합니다. 여기 Creating Reports for Test Cases per Iteration in Rally테스트 세트의 원형 차트 또는 진행률 막대 표시

답변

0

이 testcaseresults의 파이 차트를 기반으로 응용 프로그램의 JS 파일입니다 대답은 testsets 여기에 대신 결과의 실제 고장의 한 문장의 상태를 표시하는 몇 가지 코드를 제공하는 곳

나는 게시물을 발견 반복에 의해 필터링되고 테스트 세트에 의해 추가로 필터링된다. 테스트 세트 드롭 다운은 반복 드롭 다운에서 선택된 반복에 대해 스케줄 된 테스트 세트로 채워집니다. 전체 앱은 this repo에서 사용할 수 있습니다. 특정 요구 사항을 충족하기 위해 더 맞춤 설정할 수 있습니다 (예 : 릴리스 드롭 다운을 추가하십시오. 릴리스는 반복을 소유하지 않으며 시작 날짜와 종료 날짜를 기준으로하는 암시 적 연관 만 있습니다. 반복 드롭 다운의 선택 영역을 릴리스 드롭 다운의 선택 영역 앞에 두려면 this repo이라는 코드가 릴리스 내에있는 반복을 쿼리 할 수 ​​있습니다.

Ext.define('CustomApp', { 
    extend: 'Rally.app.TimeboxScopedApp', 
    componentCls: 'app', 
    scopeType: 'iteration', 
    comboboxConfig: { 
     fieldLabel: 'Select an Iteration:', 
     labelWidth: 100, 
     width: 300 
    }, 

    onScopeChange: function() { 
     if (this.down('#testSetComboxBox')) { 
     this.down('#testSetComboxBox').destroy(); 
    } 
    if (this.down('#myChart')) { 
     this.down('#myChart').destroy(); 
    } 
    var testSetComboxBox = Ext.create('Rally.ui.combobox.ComboBox',{ 
     id: 'testSetComboxBox', 
     storeConfig: { 
     model: 'TestSet', 
     limit: Infinity, 
     pageSize: 100, 
     autoLoad: true, 
     filters: [this.getContext().getTimeboxScope().getQueryFilter()] 
     }, 
     fieldLabel: 'select TestSet', 
     listeners:{ 
       ready: function(combobox){ 
      if (combobox.getRecord()) { 
      this._onTestSetSelected(combobox.getRecord()); 
      } 
      else{ 
      console.log('selected iteration has no testsets'); 
      if (this.down('#grid')) { 
       this.down('#grid').destroy(); 
      } 
      } 
     }, 
       select: function(combobox){ 
      if (combobox.getRecord()) { 
       if (this.down('#myChart')) { 
       this.down('#myChart').destroy(); 
       this._onTestSetSelected(combobox.getRecord()); 
       } 

      }   
       }, 
       scope: this 
      } 
    }); 
    this.add(testSetComboxBox); 
    }, 

    _onTestSetSelected:function(testset){ 
     this._myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait.This may take long if you have thousands of results..."}); 
     this._myMask.show(); 
    this._myStore = Ext.create('Rally.data.WsapiDataStore', { 
      model: 'Test Case Result', 
     limit: Infinity, 
      fetch: ['Verdict','TestCase','Build'], 
     filters:[ 
     { 
      property: 'TestSet', 
      value: testset.get('_ref') 
     } 
     ], 
      autoLoad: true, 
      listeners: { 
       load: this._onDataLoaded, 
       scope: this 
      } 
     }); 
    }, 


    _onDataLoaded: function(store, data) { 
      this._myMask.hide(); 
     var records = []; 
     var verdictsGroups = ["Pass","Blocked","Error","Fail","Inconclusive"] 

     var passCount = 0; 
     var blockedCount = 0; 
     var errorCount = 0; 
     var failCount = 0; 
     var inconclusiveCount = 0; 

     var getColor = { 
      'Pass': '#009900', 
      'Blocked': '#FF8000', 
      'Error': '#990000', 
      'Fail': '#FF0000', 
      'Inconclusive': '#A0A0A0' 
     }; 

     Ext.Array.each(data, function(record) { 
      verdict = record.get('Verdict'); 
      switch(verdict) 
      { 
      case "Pass": 
      passCount++; 
       break; 
      case "Blocked": 
       blockedCount++; 
       break; 
      case "Error": 
       errorCount++; 
       break; 
      case "Fail": 
       failCount++; 
       break; 
      case "Inconclusive": 
       inconclusiveCount++; 
      } 
     }); 
     if (this.down('#myChart')) { 
       this.remove('myChart'); 
     } 
     if (this.down('#myChart2')) { 
       this.remove('myChart2'); 
     } 
     this.add(
      { 
      xtype: 'rallychart', 
      height: 400, 
      storeType: 'Rally.data.WsapiDataStore', 
      store: this._myStore, 
      itemId: 'myChart', 
      chartConfig: { 
       chart: { 
       type: 'pie' 
       }, 
       title: { 
       text: 'TestCaseResults Verdict Counts', 
       align: 'center' 
       }, 
       tooltip: { 
       formatter: function() { 
        return this.point.name + ': <b>' + Highcharts.numberFormat(this.percentage, 1) + '%</b><br />' + this.point.y; 
        } 
       }, 
       plotOptions : { 
       pie: { 
        allowPointSelect: true, 
        cursor: 'pointer', 
        point: { 
        events: { 
         click: function(event) { 
         var options = this.options; 
         alert(options.name + ' clicked'); 
         } 
        } 
        }, 
        dataLabels: { 
        enabled: true, 
        color: '#000000', 
        connectorColor: '#000000' 
        } 
       } 
       } 
      },    
      chartData: { 
       series: [ 
       { 
        name: 'Verdicts', 
        data: [ 
        {name: 'Pass', 
        y: passCount, 
        color: getColor['Pass'] 
        }, 
        {name: 'Blocked', 
        y: blockedCount, 
        color: getColor['Blocked'] 
        }, 
        {name: 'Fail', 
        y: failCount, 
        color: getColor['Fail'] 
        }, 
        {name: 'Error', 
        y: errorCount, 
        color: getColor['Error'] 
        }, 
        {name: 'Inconclusive', 
        y: inconclusiveCount, 
        color: getColor['Inconclusive'] 
        } 
         ] 
       } 
       ] 
      } 
     } 
    ); 
    this.down('#myChart')._unmask(); 
    } 

}); 
+0

고맙습니다. – jaym