如何概括 Rally 上下文以包括来自与测试集关联的不同项目的测试用例
How to generalize Rally context to include TestCases from different Projects that are associated to a TestSet
我有一个使用 Rally sdk 2.1 开发的自定义拉力赛应用程序。该应用程序从 link 到当前冲刺中的测试集的测试用例中查询测试用例结果。该应用程序无法拉取一些 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);
来自拉力赛工程师:
创建 Rally.data.wsapi.Store 时,您可以将 'context' 放入配置部分。如果您不提供,则默认为当前数据上下文。当前数据上下文是您所在的项目节点以及 projectScopeUp 和 projectScopeDown。
要获取全局上下文,您可以在配置中提供此类内容:
context: {
workspace: this.getContext().getWorkspaceRef(),
project: null
},
我有一个使用 Rally sdk 2.1 开发的自定义拉力赛应用程序。该应用程序从 link 到当前冲刺中的测试集的测试用例中查询测试用例结果。该应用程序无法拉取一些 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);
来自拉力赛工程师:
创建 Rally.data.wsapi.Store 时,您可以将 'context' 放入配置部分。如果您不提供,则默认为当前数据上下文。当前数据上下文是您所在的项目节点以及 projectScopeUp 和 projectScopeDown。
要获取全局上下文,您可以在配置中提供此类内容:
context: {
workspace: this.getContext().getWorkspaceRef(),
project: null
},