【问题标题】:How to add mutiple test case results using WSAPI in Rally?如何在 Rally 中使用 ESAPI 添加多个测试用例结果?
【发布时间】:2017-02-28 17:31:42
【问题描述】:

我可以使用/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"
    }
 }

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

【问题讨论】:

  • 您可以在一个请求中将多个测试用例结果添加到同一个测试用例中。还有一个批处理端点,您可以在一个请求中创建多个项目。您使用哪个 REST 工具包与 wsapi 集成?
  • 我正在使用 Swift,因此无法使用任何工具包。我正在查看 WSAPI 的文档并试图从那里找出答案。你能把我链接到批处理端点吗?
  • 我打算一次将测试用例结果添加到不同的测试用例中。每个测试用例一个结果。这可能吗?
  • 您需要使用批处理端点。不幸的是,在 wsapi 文档中还没有一个很好的页面,但它在整个产品中被广泛使用,因此可以安全使用。我很快就会写一个示例请求格式作为这个问题的答案......

标签: web-services rally wsapi


【解决方案1】:

您可以使用 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"
                     }
                }
            }
        }
    ]
} 

【讨论】:

  • 杀手!很高兴你得到它。
  • 如何使用 Rally REST API @KyleMorse 做同样的事情
  • @Saikat restApi.getClient().doPost("/batch", body) 应该允许你这样做。您只需构建一个 JSON 对象,然后将其转换为第二个参数的字符串。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-03-24
  • 1970-01-01
  • 2017-05-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多