0

我如何检索与某个版本相关的测试用例。

我想检索与发布相关的测试用例的数据。但是测试用例没有提交发布。顺便说一句,测试用例有 WorkProduct,它是为此测试用例创建的。但是当我试图从测试用例对象中获取 WorkProdut 时,除了美国名称之外我没有任何有用的信息,实际上我可以使用这个名称来获取合法的美国对象。

不过好像很难...

4

1 回答 1

0

测试用例通过测试集安排到迭代和发布中。我在这个 github存储库中有一个应用程序,它构建了一个计划发布的故事网格,以及计划发布的测试集和相关的测试用例。

这是加载 TestSet 对象的代码片段,带有它们的 TestCases 集合,然后 TestCases 集合被水合(因为这不能在单个请求中完成):

    _makeAnotherStore: function(){
        Ext.create('Rally.data.WsapiDataStore', {
                model: 'TestSet',
                fetch: ['FormattedID', 'TestCases', 'TestCaseStatus'],  
                pageSize: 100,
                autoLoad: true,
                filters: [this.getContext().getTimeboxScope().getQueryFilter()],
                listeners: {
                    load: this._onTestSetsLoaded,
                    scope: this
                }
            }); 
    },
     _onTestSetsLoaded: function(store, data){
        console.log('store...',store);
    console.log('data...',data);
        var testSets = [];
        var pendingTestCases = data.length;
         console.log(data.length);
         if (data.length ===0) {
            this._createTestSetGrid(testSets);  
         }
         Ext.Array.each(data, function(testset){ 
            var ts  = {
                FormattedID: testset.get('FormattedID'),   
                _ref: testset.get('_ref'),  
                TestCaseStatus: testset.get('TestCaseStatus'),
                TestCaseCount: testset.get('TestCases').Count,
                TestCases: []
            };
            var testCases = testset.getCollection('TestCases');
            testCases.load({
                                fetch: ['FormattedID'],
                                callback: function(records, operation, success){
                                    Ext.Array.each(records, function(testcase){
                                        ts.TestCases.push({_ref: testcase.get('_ref'),
                                                        FormattedID: testcase.get('FormattedID')
                                                    });
                                    }, this);
                                    --pendingTestCases;
                                    if (pendingTestCases === 0) {
                                        this._createTestSetGrid(testSets);
                                    }
                                },
                                scope: this
                            });
            testSets.push(ts);
     },this);
 }

,

于 2014-04-17T15:05:43.170 回答