gpt4 book ai didi

testing - 自定义 Rally Grid 列和 Rally 数据列

转载 作者:行者123 更新时间:2023-11-28 20:44:18 26 4
gpt4 key购买 nike

我正在尝试创建一个应用程序,它将显示当前项目中的所有测试集及其通过/失败总数的状态。我面临的问题(顺便说一句,昨天刚开始学习 ExtJS 和 Rally SDK):
- 我需要了解如何使用当前选择的项目作为在网格中起诉的项目作为过滤器
- 应如何查询测试集通过/失败总数,然后将其显示在网格的列中 - 示例:测试集 123 | 45/70

最佳答案

这是一个使用 project picker 的应用示例并按项目构建测试集网格。另请参阅 this post 中的代码示例. Web Services API 中没有归档计算通过/失败总数的地方。您将不得不迭代结果并计算代码中的总数。我鼓励通过某些标准限制测试用例结果的数量,例如创建日期。在测试用例结果自动生成的情况下,庞大的数据量可能会产生问题。

Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',

launch: function() {
var c = Ext.create('Ext.Container', {
items: [
{
xtype: 'rallyprojectpicker',
fieldLabel: 'select project',
listeners:{
change: function(combobox){
if ( this.down('#g')) {
console.log('grid exists');
Ext.getCmp('g').destroy();
console.log('grid deleted');
}
this.onProjectSelected(combobox.getSelectedRecord());
},
scope: this
}
},
],
});
this.add(c);
},

onProjectSelected:function(record){
var project = record.data['_ref'];
console.log('project', project);
var testSetStore = Ext.create('Rally.data.WsapiDataStore', {
model: 'TestSet',
fetch: ['FormattedID','Name', 'Project', 'TestCaseStatus'],
pageSize: 100,
autoLoad: true,
filters: [
{
property: 'Project',
value: project
}
],
listeners: {
load: this.onTestSetsLoaded,
scope: this
}
});


},

onTestSetsLoaded:function(store, data){
var testSets = [];
Ext.Array.each(data, function(testset) {
var ts = {
FormattedID: testset.get('FormattedID'),
_ref: testset.get("_ref"),
Name: testset.get('Name'),
TestCaseStatus: testset.get('TestCaseStatus')
};
testSets.push(ts);
});
this.updateGrid(testSets);

},


updateGrid: function(testSets){
var store = Ext.create('Rally.data.custom.Store', {
data: testSets,
pageSize: 100
});
if (!this.down('#g')) {
this.createGrid(store);
}
else{
this.down('#g').reconfigure(store);
}
},

createGrid: function(store){
console.log("load grid", store);

var g = Ext.create('Rally.ui.grid.Grid', {
id: 'g',
store: store,

columnCfgs: [
{
text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn',
tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
},
{
text: 'Name', dataIndex: 'Name'
},
{
text: 'TestCaseStatus', dataIndex: 'TestCaseStatus'
}
]
});
this.add(g);
},
});

此示例的完整 html 源代码可从 this repo 获得。

关于testing - 自定义 Rally Grid 列和 Rally 数据列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19887056/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com