【发布时间】:2017-01-31 17:42:41
【问题描述】:
编辑:我最终使用 Rally.data.util.Record.serverSideCopy() 并重新检索/更新新的测试用例来完成这项工作。我没有解决这个问题,因为我仍然无法弄清楚我为什么要让 404 同步(不过,我可能没有时间深入研究它,因为我走的是不同的方向)。
我正在尝试将 TestCaseSteps 添加到 TestCase(我从另一个 TestCase 复制的 - 原始步骤集合在保存过程中丢失,因为它们与原始 TestCase 相关联)。我尝试遵循 Collection Modification section of the doc 中建议的添加/同步模式,但仅提供 Steps 的 _ref 值会导致 sync() 操作失败并在 POST 上出现 404:
HTTP ERROR 404
Problem accessing /slm/webservice/v2.0/TestCase/90167266916/Steps/add. Reason:
Not Found
如下所示,然后我尝试通过原始对象而不是 _ref 值添加步骤,但我收到了相同的 404。
我在这里做错了什么?为什么我的同步操作会导致 404?
为了进一步了解,这里是回购: https://github.com/crdschurch/reuse-rally-test
var newSteps = newTestCase.getCollection('Steps', {autoLoad: true});
oldTestCase.getCollection('Steps').load({
callback: function(oldRecords, newOperation, newSuccess) {
Ext.Array.each(oldRecords, function(step) {
console.log(step.get('_ref'));
//debugger;
newSteps.add(
{
'Input': step.get('Input'),
'ExpectedResult': step.get('ExpectedResult'),
'StepIndex': step.get('StepIndex'),
'TestCase': newTestCase.get('ObjectID')
}
);
});
console.log('Syncing: ');
console.log(newSteps);
newSteps.sync({
callback: function() {
console.log('New Test: ');
console.log(newTestCase);
}
});
}
});
【问题讨论】:
标签: javascript post sdk rally