如何使用 Cucumber 和 Rally 集成自动更新 Rally 测试用例?
How can I update Rally test cases automatically using Cucumber and Rally integration?
我正在尝试弄清楚如何通过 Cucumber 自动化脚本自动更新 Rally 中测试用例的测试用例结果。我希望能够 运行 我的测试脚本,然后它将自动更新 Rally 中的测试用例结果以通过或失败。
有什么办法可以用 Cucumber 做到这一点吗?我将 Cucumber 与 TestNG 和 Rest Assured 一起使用。
如果您使用的是超级小黄瓜集 TestNG's QAF extension for BDD it provides a way to integrate your test results with test management tool by providing TestCaseResultUpdator
. In your test case or scenario you need to provide test case id from test management tool and call api to update test result for that test case. QAF supports gherkin but gherking doesn't support custom meta-data. You can use BDD2,您的场景可能如下所示:
@smoke @RallyId:TC-12345
Scenario: A scenario
Given step represents a precondition to an event
When step represents the occurrence of the event
Then step represents the outcome of the event
在上面的例子中假设RallyId
代表测试管理工具中的测试用例id。您可以在实现结果更新器时使用它。
package example;
...
public class RallyResultUpdator implements TestCaseResultUpdator{
@Override
public String getToolName() {
return "Rally";
}
/**
* This method will be called by result updator after completion of each testcase/scenario.
* @param params
* tescase/scenario meta-data including method parameters if any
* @param result
* test case result
* @param details
* run details
* @return
*/
@Override
public boolean updateResult(Map<String, ? extends Object> metadata,
TestCaseRunResult result, String details) {
String tcid = metadata.get("RallyId");
// Provide test management tool specific implemeneation/method calls
return true;
}
}
按如下方式注册您的更新程序:
result.updator=example.RallyResultUpdator
结果更新器将在测试用例完成时由 qaf 自动调用,并将 运行 在单独的线程中,因此您的测试执行无需等待。
我正在尝试弄清楚如何通过 Cucumber 自动化脚本自动更新 Rally 中测试用例的测试用例结果。我希望能够 运行 我的测试脚本,然后它将自动更新 Rally 中的测试用例结果以通过或失败。
有什么办法可以用 Cucumber 做到这一点吗?我将 Cucumber 与 TestNG 和 Rest Assured 一起使用。
如果您使用的是超级小黄瓜集 TestNG's QAF extension for BDD it provides a way to integrate your test results with test management tool by providing TestCaseResultUpdator
. In your test case or scenario you need to provide test case id from test management tool and call api to update test result for that test case. QAF supports gherkin but gherking doesn't support custom meta-data. You can use BDD2,您的场景可能如下所示:
@smoke @RallyId:TC-12345
Scenario: A scenario
Given step represents a precondition to an event
When step represents the occurrence of the event
Then step represents the outcome of the event
在上面的例子中假设RallyId
代表测试管理工具中的测试用例id。您可以在实现结果更新器时使用它。
package example;
...
public class RallyResultUpdator implements TestCaseResultUpdator{
@Override
public String getToolName() {
return "Rally";
}
/**
* This method will be called by result updator after completion of each testcase/scenario.
* @param params
* tescase/scenario meta-data including method parameters if any
* @param result
* test case result
* @param details
* run details
* @return
*/
@Override
public boolean updateResult(Map<String, ? extends Object> metadata,
TestCaseRunResult result, String details) {
String tcid = metadata.get("RallyId");
// Provide test management tool specific implemeneation/method calls
return true;
}
}
按如下方式注册您的更新程序:
result.updator=example.RallyResultUpdator
结果更新器将在测试用例完成时由 qaf 自动调用,并将 运行 在单独的线程中,因此您的测试执行无需等待。