如何概括Rally上下文,以包括来自不同项目的TestCases,这些项目关联到一个TestSet。

问题描述 投票:0回答:1

我有一个使用Rally sdk 2.1开发的自定义拉力赛应用程序。该应用程序从测试用例中查询测试用例结果,这些测试用例链接到当前冲刺的测试集。有一个问题是该应用程序无法拉动一些TC。当你有一个TS有来自多个项目的TC时,问题就会出现。应用上下文会启动,只允许从当前项目上下文查询TC,造成数据缺口。

下面的代码是检索测试用例结果的数据,但受到项目上下文的限制。

var tsid = req.testsetid;
        var ts = req.testsetname;        
        Ext.Array.each(data, function (testcase) {
            var tcid = testcase.get('ObjectID');
            Ext.create('Rally.data.WsapiDataStore', {
                model: 'testcaseresult',
                fetch: ['Verdict', 'Date'],
                limit: Infinity,
                autoLoad: true,
                filters: [
                {
                    property: 'TestCase.ObjectID',
                    operator: '=',
                    value: tcid
                },
                {
                    property: 'TestSet.ObjectID',
                    operator: '=',
                    value: tsid
                }],
                sorters: { property: 'Date', direction: 'DESC' },
                listeners: {
                    load: this._testCaseResultDataLoaded,
                    itemname: ts,
                    scope: this
                }
            });
        }, this);
sdk rally code-rally
1个回答
0
投票

来自Rally工程师。

当创建一个Rally.data.wsapi.Store时,你可以在config部分给出 "context"。如果你没有给出,它默认为当前数据上下文。当前的数据上下文是你所在的项目节点和projectScopeUp和projectScopeDown。

为了得到全局上下文,你可以在config中提供这种东西。

    context: {
        workspace: this.getContext().getWorkspaceRef(),
        project: null
    },
© www.soinside.com 2019 - 2024. All rights reserved.