我有用JAVA编写的selenium自动化测试框架。与Junit5和猕猴桃的junit集成。
我试图根据我的自动测试结果更新猕猴桃上的测试执行。首先,我想知道这可行吗?
Im能够创建连接和登录,但是没有熟悉的方法来更新特定测试用例的测试执行。
RpcClient kiwi = new RpcClient();
kiwi.login("my_username", "my_password");
//I need here something like
kiwi.updateTestCaseExecution("specific_test_run", "specific_test_case", "test_status");
kiwi.logout();任何帮助都将不胜感激!
发布于 2020-10-26 12:07:23
JAVA有用
编写的selenium自动化测试框架。与Junit5和猕猴桃的junit集成。
我试图根据我的自动测试结果更新猕猴桃上的测试执行。首先,我想知道这可行吗?
正如你已经看到的那样。
Im可以创建连接和登录,但是没有熟悉的方法来更新特定测试用例的测试执行。
参见此方法:https://github.com/kiwitcms/junit-plugin/blob/master/src/main/java/org/kiwitcms/java/api/RpcClient.java#L243第一个参数是TE ID,第二个参数是状态ID。
我无法获得基于CaseID的ExecutionId
您需要TestExecution.filter()来通过runId和caseId:https://github.com/kiwitcms/junit-plugin/blob/master/src/main/java/org/kiwitcms/java/api/RpcClient.java#L228进行过滤
还请参阅https://kiwitcms.readthedocs.io/en/latest/modules/tcms.rpc.api.html#module-tcms.rpc.api获取信息,API接受哪些参数,以及如何进行查询。
请成为一个优秀的开源公民,并考虑在https://github.com/kiwitcms/api-scripts上贡献您的Selenium胶代码,以帮助可能感兴趣的其他人。
更新:
TestCase[] testCases = kiwi.getRunIdTestCases(2);
底层TestRun.get_cases() API方法返回的原始JSON包含status和execution_id字段,但是junit插件库中的execution_id序列化程序代码忽略了它们--它们不是TestCase模型的一部分,参见model/TestCase.java。
发布于 2020-10-23 09:08:39
我现在很亲密:
有更新测试执行的方法:
kiwi.updateTestExecution(ExecutionId,status);但我无法获得基于ExecutionId的CaseID

如果我跑:
TestCase[] testCases = kiwi.getRunIdTestCases(2);我得到:

没有执行ID
发布于 2020-10-27 11:59:08
谢谢https://stackoverflow.com/users/1431647/alexander-todorov
完整的例子:
//create client instance
RpcClient kiwi = new RpcClient();
//login
kiwi.login("username", "password");
//every selenium test case should have assigned case id (from kiwi)
int runId = "your_run_id";
//search for execution ID based on case ID and run ID
Map<String, Object> params = new HashMap<>();
params.put("run_id", runId);
params.put("case_id", "your_case_id");
TestExecution tcExec = kiwi.getTestExecution(params);
int tcExecId = tcExec.getTcRunId();
//update execution with results
kiwi.updateTestExecution(tcExecId, 5);
//test statuses
//1 - IDLE
//2 - RUNNING
//3 - PAUSED
//4 - PASSED
//5 - FAILED
//6 - BLOCKED
//7 - ERROR
//8 - WAIVEDhttps://stackoverflow.com/questions/64482548
复制相似问题