如何在Rally中使用WSAPI添加多个测试用例结果?

时间:2017-02-28 17:31:43

标签: web-services rally wsapi

我可以使用/testcaseresult/create API添加单个测试用例结果,并将JSON传递为:

 {
    "testcaseresult":
    {
        "Build":5,
        "Date":"2017-02-27T18:03:29.260Z",
        "Testcase":{"_ref":"https://rally1.rallydev.com/slm/webservice/v2.0/TestCase/12345678"},
        "Verdict":"Pass"
    }
 }

有没有办法添加多个测试用例结果?

1 个答案:

答案 0 :(得分:2)

您可以使用wsapi批处理端点同时创建多个项目:

发布网址:https://rally1.rallydev.com/slm/webservice/v2.0/batch

发帖机构:

{
    "Batch": [
        {
            "Entry": {
                "Path": "/testcaseresult/create",
                "Method": "POST",
                "Body": {
                    "testcaseresult": {
                        "Build":5,
                        "Date":"2017-02-27T18:03:29.260Z",
                        "Testcase": "/TestCase/12345678",
                        "Verdict":"Pass"
                     }
                }
            }
        },
        {
            "Entry": {
                "Path": "/testcaseresult/create",
                "Method": "POST",
                "Body": {
                    "testcaseresult": {
                        "Build":5,
                        "Date":"2017-02-27T18:03:29.260Z",
                        "Testcase": "/TestCase/1234",
                        "Verdict":"Fail"
                     }
                }
            }
        }
    ]
}