Search code examples
javajunit5kiwi-tcms

Kiwi-tcms | junit-plugin | Not able to publish test results to Kiwi


I have selenium automation test framework written in JAVA. Integrated with Junit5 and kiwi's junit-plugin.

Im trying to update test execution on kiwi based on my automated test result. First, im wondering is that doable?

Im able to create connection and login, but there are no familiar methods to update test execution for specific test case.

    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();

Any help would be appreciated!


Solution

  • I have selenium automation test framework written in JAVA. Integrated with Junit5 and kiwi's junit-plugin.

    Im trying to update test execution on kiwi based on my automated test result. First, im wondering is that doable?

    As you have already seen it is.

    Im able to create connection and login, but there are no familiar methods to update test execution for specific test case.

    See this method: https://github.com/kiwitcms/junit-plugin/blob/master/src/main/java/org/kiwitcms/java/api/RpcClient.java#L243 First parameter is the TE ID, the second one is a status ID.

    I cannot get this ExecutionId based on CaseID

    You need TestExecution.filter() to filter by runId and caseId: https://github.com/kiwitcms/junit-plugin/blob/master/src/main/java/org/kiwitcms/java/api/RpcClient.java#L228

    Also see https://kiwitcms.readthedocs.io/en/latest/modules/tcms.rpc.api.html#module-tcms.rpc.api for information what parameters are accepted by the API and how to make queries.

    Please be a good open source citizen and consider contributing your Selenium glue code at https://github.com/kiwitcms/api-scripts to help others who may be interested.

    Update:

    TestCase[] testCases = kiwi.getRunIdTestCases(2);

    The raw JSON returned by the underlying TestRun.get_cases() API method contains both status and execution_id fields but the Java serializer code in the junit-plugin library ignores them b/c they aren't part of the TestCase model, see model/TestCase.java.