我對Rally相當陌生,迄今爲止只使用了Web界面(我還沒有使用過編程語言的Rally API)。偶爾,我們有一個測試集,我們並不在一個迭代完成,所以我們希望能夠將測試集複製到下一次迭代,但保留了測試結果的情況下,在新的迭代進入至今讓我們不要不必在2個不同的地方查看完整的測試集結果。也許一種解決方案是更好的迭代計劃,但是我仍然好奇,複製測試集時是否有辦法複製測試用例結果和測試集。在拉力賽中,當複製測試集時,如何將測試用例結果與測試集複製?
1
A
回答
0
測試用例結果不能被複制。它可以使用相同的數據在UI或Web Services API中創建,但不支持複製功能。
有關如何使用瀏覽器REST客戶端創建TCR對象的一般示例,請參閱此SO post here。
這是一個概念應用程序的poof創建一個現有的TCR的副本。該應用程序按Iteration過濾TestSets,並將這些TestSets加載到組合框中。根據組合框中的TestSet選擇,創建另一個組合框,並填充TestCases。從該組合框中選擇測試用例時,將使用TestCaseResults構建網格。在網格中雙擊一個TCR將調用複製功能。請參閱AppSDK2主題,瞭解如何複製記錄here。您可以根據您的規格擴展代碼。來源於this github repo。
微創您需要更改目的地測試用例和目標測試在下面_copyRecordOnDoubleClick方法設置的ObjectID:
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('#testCaseComboxBox')) {
this.down('#testCaseComboxBox').destroy();
}
if (this.down('#resultsGrid')) {
this.down('#resultsGrid').destroy();
}
var testSetComboxBox = Ext.create('Rally.ui.combobox.ComboBox',{
id: 'testSetComboxBox',
storeConfig: {
model: 'TestSet',
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');
}
},
select: function(combobox){
if (combobox.getRecord()) {
this._onTestSetSelected(combobox.getRecord());
}
},
scope: this
}
});
this.add(testSetComboxBox);
},
_onTestSetSelected:function(selectedTestset){
var testCases = selectedTestset.getCollection('TestCases', {fetch: ['FormattedID','ObjectID', 'Results']});
var ts = {
FormattedID: selectedTestset.get('FormattedID'),
TestCaseCount: selectedTestset.get('TestCases').Count,
TestCases: [],
ResultCount: 0
};
testCases.load({
callback: function(records, operation, success){
Ext.Array.each(records, function(testcase){
console.log("testcase.get('FormattedID')", testcase.get('FormattedID'));
console.log("testcase.get('Results').Count", testcase.get('Results').Count);
ts.ResultCount = testcase.get('Results').Count;
ts.TestCases.push({_ref: testcase.get('_ref'),
FormattedID: testcase.get('FormattedID'),
ObjectID: testcase.get('ObjectID')
});
}, this);
this._makeTestCaseCombobox(ts.TestCases);
},
scope: this
});
},
_makeTestCaseCombobox:function(testcases){
if (this.down('#testCaseComboxBox')) {
this.down('#testCaseComboxBox').destroy();
}
if (this.down('#resultsGrid')) {
this.down('#resultsGrid').destroy();
}
if (testcases.length>0) {
var idArray = [];
_.each(testcases, function(testcase){
console.log(testcase);
console.log('OID', testcase['ObjectID']);
idArray.push(testcase['ObjectID']);
});
console.log('idArray',idArray);
var filterArray = [];
_.each(idArray, function(id){
filterArray.push(
{
property: 'ObjectID',
value:id
}
)
});
var filters = Ext.create('Rally.data.QueryFilter', filterArray[0]);
filterArray = _.rest(filterArray,1);
_.each(filterArray, function(filter){
filters = filters.or(filter)
},1);
var testCaseComboxBox = Ext.create('Rally.ui.combobox.ComboBox',{
id: 'testCaseComboxBox',
storeConfig: {
model: 'TestCase',
pageSize: 100,
autoLoad: true,
filters:filters,
fetch: true
},
fieldLabel: 'select TestCase',
listeners:{
ready: function(combobox){
if (combobox.getRecord()) {
this._onTestCaseSelected(combobox.getRecord());
}
else{
console.log('selected testset has no testcases');
}
},
select: function(combobox){
if (combobox.getRecord()) {
this._onTestCaseSelected(combobox.getRecord());
}
},
scope: this
}
});
this.add(testCaseComboxBox);
}
else{
console.log('selected testset has no testcases');
}
},
_onTestCaseSelected:function(selectedTestcase){
var results = selectedTestcase.getCollection('Results', {fetch: ['ObjectID','Date', 'TestSet', 'TestCase', 'Build', 'Verdict']});
var tc = {
ObjectID: selectedTestcase.get('ObjectID'),
FormattedID: selectedTestcase.get('FormattedID'),
Results: []
};
results.load({
callback: function(records, operation, success){
Ext.Array.each(records, function(result){
console.log("result.get('ObjectID')", result.get('ObjectID'));
console.log("result.get('Verdict')", result.get('Verdict'));
tc.Results.push({_ref: result.get('_ref'),
ObjectID: result.get('ObjectID'),
Date: result.get('Date'),
Build: result.get('Build'),
Verdict: result.get('Verdict')
});
}, this);
this._updateGrid(tc.Results);
},
scope: this
});
},
_updateGrid: function(results){
var store = Ext.create('Rally.data.custom.Store', {
data: results,
pageSize: 100
});
if (!this.down('#resultsGrid')) {
this._createGrid(store);
}
else{
this.down('#resultsGrid').reconfigure(store);
}
},
_createGrid: function(store){
var that = this;
var that = this;
var resultsGrid = Ext.create('Rally.ui.grid.Grid', {
id: 'resultsGrid',
store: store,
columnCfgs: [
{
text: 'ObjectID ID', dataIndex: 'ObjectID',
},
{
text: 'Date', dataIndex: 'Date',
},
{
text: 'Build', dataIndex: 'Build',
},
{
text: 'Verdict', dataIndex: 'Verdict',
},
],
listeners: {
celldblclick: function(grid, td, cellIndex, record, tr, rowIndex){
that._copyRecordOnDoubleClick(record);
}
}
});
this.add(resultsGrid);
},
_copyRecordOnDoubleClick: function(record){
var that = this;
console.log('record', record);
Rally.data.ModelFactory.getModel({
type: 'TestCaseResult',
success: function(model) {
that._model = model;
var copy = Ext.create(model, {
Date: record.get('Date'),
Build: record.get('Build'),
Verdict: record.get('Verdict'),
TestCase: '/testcase/17237838118',
TestSet: '/testset/17234968911'
});
copy.save({
callback: function(result, operation) {
if(operation.wasSuccessful()) {
console.log('result',result);
}
else{
console.log("problem");
}
}
});
}
});
}
});
相關問題
- 1. 拉力賽:在測試用例中更新測試文件夾
- 2. 新的拉力賽API,試圖添加測試用例結果
- 3. CA拉力賽 - 導入測試用例
- 4. NUnit,TestDriven.Net:使用部分測試類複製測試結果
- 5. 拉力賽:如何從特定測試集拉最新testresult
- 6. 集成測試的測試控制器
- 7. rspec與自動測試軌複製控制檯中的測試
- 8. 如何在拉力賽中使用WSAPI添加多重測試用例結果?
- 9. 噶輸出複製測試結果
- 10. 如何將monkeyrunner集成測試與emma覆蓋測試集成?
- 11. 如何獲得與拉力賽API測試用例名稱
- 12. 如何使用Rapidminer測試測試集?
- 13. 如何將測試結果鏈接到測試用例?
- 14. 將PHPT測試用例與PHPUnit集成
- 15. 如何導出測試案例與測試步驟從集會?
- 16. 只有當我使用Maven運行測試用例時,TestNG測試結果控制檯才爲空(測試)
- 17. XCUI測試:如何測試集發生
- 18. 集成測試與單元測試
- 19. 集成測試與單元測試
- 20. 集成Selenium測試結果與TestRail 4.0
- 21. 將測試結果添加到VSTS中的測試運行(測試用例)
- 22. 如何更新拉力賽測試用例步驟
- 23. 如何在單元測試時將配置文件複製到測試結果目錄中?
- 24. 如何將單元測試與集成測試分開?
- 25. SQL Server複製測試
- 26. 如何在發佈測試用例結果時添加測試用例
- 27. Rally:如何向測試集添加更多測試用例
- 28. 集成測試/單元測試:做了太多集成測試?
- 29. Maven和在測試時刻複製
- 30. 與Rails控制器(集成?)測試
如果測試結果可以與Web服務API來創建,你知道某種腳本可以將測試集的一個副本的測試結果複製到另一個副本? – user3347890
我更新了代碼示例答案。 – nickm