Skip to content

Commit

Permalink
Merge pull request #204 from gurock/robot70
Browse files Browse the repository at this point in the history
preliminary support for RF 7.0 new output.xml format; fixes #203 #201
  • Loading branch information
bitcoder authored Feb 8, 2024
2 parents afeb482 + f5356ca commit dd267ee
Show file tree
Hide file tree
Showing 19 changed files with 832 additions and 132 deletions.
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ trcli
```
You should get something like this:
```
TestRail CLI v1.8.0
Copyright 2023 Gurock Software GmbH - www.gurock.com
TestRail CLI v1.9.0
Copyright 2024 Gurock Software GmbH - www.gurock.com
Supported and loaded modules:
- parse_junit: JUnit XML Files (& Similar)
- parse_robot: Robot Framework XML Files
Expand All @@ -41,11 +41,9 @@ Supported and loaded modules:
CLI general reference
--------
```shell
trcli --help
```
```shell
TestRail CLI v1.8.0
Copyright 2023 Gurock Software GmbH - www.gurock.com
$ trcli --help
TestRail CLI v1.9.0
Copyright 2024 Gurock Software GmbH - www.gurock.com
Usage: trcli [OPTIONS] COMMAND [ARGS]...

TestRail CLI
Expand Down Expand Up @@ -255,11 +253,9 @@ providing you with a solid base of test cases, which you can further expand on T
### Reference
```shell
trcli parse_openapi --help
```
```shell
TestRail CLI v1.5.0
Copyright 2021 Gurock Software GmbH - www.gurock.com
$ trcli parse_openapi --help
TestRail CLI v1.9.0
Copyright 2024 Gurock Software GmbH - www.gurock.com
Usage: trcli parse_openapi [OPTIONS]
Parse OpenAPI spec and create cases in TestRail
Expand Down
89 changes: 89 additions & 0 deletions tests/test_data/XML/robotframework_id_in_name_RF70.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot generator="Rebot 7.0 (Python 3.10.13 on darwin)" generated="2024-02-06T11:14:56.073346" rpa="false" schemaversion="5">
<suite id="s1" name="Sub-Tests" source="rf\tests-basic\sub-tests">
<suite id="s1-s1" name="Subtests 1" source="rf\tests-basic\sub-tests\subtests 1.robot">
<kw name="Log" owner="BuiltIn" type="SETUP">
<msg time="2023-07-12T22:32:12.951000" level="INFO">SETUP</msg>
<arg>SETUP</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.950000" elapsed="0.001000"/>
</kw>
<test id="s1-s1-t1" name="[C1] Subtest 1a" line="5">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.952000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.951000" elapsed="0.001000"/>
</kw>
<kw name="Set Test Message" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.952000" level="INFO">Set test message to:
Custom test message
</msg>
<arg>Custom test message</arg>
<doc>Sets message for the current test case.</doc>
<status status="PASS" start="2023-07-12T22:32:12.952000" elapsed="0.000000"/>
</kw>
<doc>Some documentation about my test Cases
Nothing to see here

- testrail_case_id: C123
- testrail_case_field: refs:TR-1
- testrail_case_field: priority_id:2
- testrail_result_field: custom_environment:qa
- testrail_result_field: custom_dropdown_1:3
- testrail_result_comment: Notes for the result
- testrail_attachment: /reports/screenshot.png
</doc>
<status status="PASS" start="2023-07-12T22:32:12.951000" elapsed="0.001000">Custom test message
</status>
</test>
<test id="s1-s1-t2" name="C2 Subtest 1b" line="15">
<kw name="Fail" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.955000" level="FAIL">NOK</msg>
<arg>NOK</arg>
<doc>Fails the test with the given message and optionally alters its tags.</doc>
<status status="FAIL" start="2023-07-12T22:32:12.954000" elapsed="0.001000"/>
</kw>
<status status="FAIL" start="2023-07-12T22:32:12.953000" elapsed="0.003000">NOK</status>
</test>
<status status="FAIL" start="2023-07-12T22:32:12.943000" elapsed="0.014000"/>
</suite>
<suite id="s1-s2" name="Subtests 2" source="rf\tests-basic\sub-tests\subtests 2.robot">
<test id="s1-s2-t1" name="Subtest 2a [C3]" line="5">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.963000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.963000" elapsed="0.000000"/>
</kw>
<status status="PASS" start="2023-07-12T22:32:12.962000" elapsed="0.001000"/>
</test>
<test id="s1-s2-t2" name="Subtest 2b C4" line="8">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.965000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.965000" elapsed="2.000000"/>
</kw>
<status status="PASS" start="2023-07-12T22:32:12.964000" elapsed="3.001000"/>
</test>
<doc>Simple homepage links tests</doc>
<status status="PASS" start="2023-07-12T22:32:12.960000" elapsed="4.006000"/>
</suite>
<status status="FAIL" start="2023-07-12T22:32:12.928000" elapsed="6.040000"/>
</suite>
<statistics>
<total>
<stat pass="3" fail="1" skip="0">All Tests</stat>
</total>
<tag>
</tag>
<suite>
<stat pass="3" fail="1" skip="0" id="s1" name="Sub-Tests">Sub-Tests</stat>
<stat pass="1" fail="1" skip="0" id="s1-s1" name="Subtests 1">Sub-Tests.Subtests 1</stat>
<stat pass="2" fail="0" skip="0" id="s1-s2" name="Subtests 2">Sub-Tests.Subtests 2</stat>
</suite>
</statistics>
<errors>
</errors>
</robot>
92 changes: 92 additions & 0 deletions tests/test_data/XML/robotframework_id_in_property_RF70.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot generator="Rebot 7.0 (Python 3.10.13 on darwin)" generated="2024-02-06T11:15:19.930953" rpa="false" schemaversion="5">
<suite id="s1" name="Sub-Tests" source="rf\tests-basic\sub-tests">
<suite id="s1-s1" name="Subtests 1" source="rf\tests-basic\sub-tests\subtests 1.robot">
<kw name="Log" owner="BuiltIn" type="SETUP">
<msg time="2023-07-12T22:32:12.951000" level="INFO">SETUP</msg>
<arg>SETUP</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.950000" elapsed="0.001000"/>
</kw>
<test id="s1-s1-t1" name="Subtest 1a" line="5">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.952000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.951000" elapsed="0.001000"/>
</kw>
<kw name="Set Test Message" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.952000" level="INFO">Set test message to:
Custom test message
</msg>
<arg>Custom test message</arg>
<doc>Sets message for the current test case.</doc>
<status status="PASS" start="2023-07-12T22:32:12.952000" elapsed="0.000000"/>
</kw>
<doc>Some documentation about my test Cases
Nothing to see here

- testrail_case_id: C1
- testrail_case_field: refs:TR-1
- testrail_case_field: priority_id:2
- testrail_result_field: custom_environment:qa
- testrail_result_field: custom_dropdown_1:3
- testrail_result_comment: Notes for the result
- testrail_attachment: /reports/screenshot.png
</doc>
<status status="PASS" start="2023-07-12T22:32:12.951000" elapsed="0.001000">Custom test message
</status>
</test>
<test id="s1-s1-t2" name="Subtest 1b" line="15">
<kw name="Fail" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.955000" level="FAIL">NOK</msg>
<arg>NOK</arg>
<doc>Fails the test with the given message and optionally alters its tags.</doc>
<status status="FAIL" start="2023-07-12T22:32:12.954000" elapsed="0.001000"/>
</kw>
<doc>- testrail_case_id: c2</doc>
<status status="FAIL" start="2023-07-12T22:32:12.953000" elapsed="0.003000">NOK</status>
</test>
<status status="FAIL" start="2023-07-12T22:32:12.943000" elapsed="0.014000"/>
</suite>
<suite id="s1-s2" name="Subtests 2" source="rf\tests-basic\sub-tests\subtests 2.robot">
<test id="s1-s2-t1" name="Subtest 2a" line="5">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.963000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.963000" elapsed="0.000000"/>
</kw>
<doc>- testrail_case_id: 3</doc>
<status status="PASS" start="2023-07-12T22:32:12.962000" elapsed="0.001000"/>
</test>
<test id="s1-s2-t2" name="Subtest 2b" line="8">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.965000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.965000" elapsed="2.000000"/>
</kw>
<doc>- testrail_case_id: 4 </doc>
<status status="PASS" start="2023-07-12T22:32:12.964000" elapsed="3.001000"/>
</test>
<doc>Simple homepage links tests</doc>
<status status="PASS" start="2023-07-12T22:32:12.960000" elapsed="4.006000"/>
</suite>
<status status="FAIL" start="2023-07-12T22:32:12.928000" elapsed="6.040000"/>
</suite>
<statistics>
<total>
<stat pass="3" fail="1" skip="0">All Tests</stat>
</total>
<tag>
</tag>
<suite>
<stat pass="3" fail="1" skip="0" id="s1" name="Sub-Tests">Sub-Tests</stat>
<stat pass="1" fail="1" skip="0" id="s1-s1" name="Subtests 1">Sub-Tests.Subtests 1</stat>
<stat pass="2" fail="0" skip="0" id="s1-s2" name="Subtests 2">Sub-Tests.Subtests 2</stat>
</suite>
</statistics>
<errors>
</errors>
</robot>
89 changes: 89 additions & 0 deletions tests/test_data/XML/robotframework_simple_RF70.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot generator="Rebot 7.0 (Python 3.10.13 on darwin)" generated="2024-02-06T11:15:42.242542" rpa="false" schemaversion="5">
<suite id="s1" name="Sub-Tests" source="rf\tests-basic\sub-tests">
<suite id="s1-s1" name="Subtests 1" source="rf\tests-basic\sub-tests\subtests 1.robot">
<kw name="Log" owner="BuiltIn" type="SETUP">
<msg time="2023-07-12T22:32:12.951000" level="INFO">SETUP</msg>
<arg>SETUP</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.950000" elapsed="0.001000"/>
</kw>
<test id="s1-s1-t1" name="Subtest 1a" line="5">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.952000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.951000" elapsed="0.001000"/>
</kw>
<kw name="Set Test Message" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.952000" level="INFO">Set test message to:
Custom test message
</msg>
<arg>Custom test message</arg>
<doc>Sets message for the current test case.</doc>
<status status="PASS" start="2023-07-12T22:32:12.952000" elapsed="0.000000"/>
</kw>
<doc>Some documentation about my test Cases
Nothing to see here

- testrail_case_id: C123
- testrail_case_field: refs:TR-1
- testrail_case_field: priority_id:2
- testrail_result_field: custom_environment:qa
- testrail_result_field: custom_dropdown_1:3
- testrail_result_comment: Notes for the result
- testrail_attachment: /reports/screenshot.png
</doc>
<status status="PASS" start="2023-07-12T22:32:12.951000" elapsed="0.001000">Custom test message
</status>
</test>
<test id="s1-s1-t2" name="Subtest 1b" line="15">
<kw name="Fail" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.955000" level="FAIL">NOK</msg>
<arg>NOK</arg>
<doc>Fails the test with the given message and optionally alters its tags.</doc>
<status status="FAIL" start="2023-07-12T22:32:12.954000" elapsed="0.001000"/>
</kw>
<status status="FAIL" start="2023-07-12T22:32:12.953000" elapsed="0.003000">NOK</status>
</test>
<status status="FAIL" start="2023-07-12T22:32:12.943000" elapsed="0.014000"/>
</suite>
<suite id="s1-s2" name="Subtests 2" source="rf\tests-basic\sub-tests\subtests 2.robot">
<test id="s1-s2-t1" name="Subtest 2a" line="5">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.963000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.963000" elapsed="0.000000"/>
</kw>
<status status="PASS" start="2023-07-12T22:32:12.962000" elapsed="0.001000"/>
</test>
<test id="s1-s2-t2" name="Subtest 2b" line="8">
<kw name="Log" owner="BuiltIn">
<msg time="2023-07-12T22:32:12.965000" level="INFO">OK</msg>
<arg>OK</arg>
<doc>Logs the given message with the given level.</doc>
<status status="PASS" start="2023-07-12T22:32:12.965000" elapsed="2.000000"/>
</kw>
<status status="PASS" start="2023-07-12T22:32:12.964000" elapsed="3.001000"/>
</test>
<doc>Simple homepage links tests</doc>
<status status="PASS" start="2023-07-12T22:32:12.960000" elapsed="4.006000"/>
</suite>
<status status="FAIL" start="2023-07-12T22:32:12.928000" elapsed="6.040000"/>
</suite>
<statistics>
<total>
<stat pass="3" fail="1" skip="0">All Tests</stat>
</total>
<tag>
</tag>
<suite>
<stat pass="3" fail="1" skip="0" id="s1" name="Sub-Tests">Sub-Tests</stat>
<stat pass="1" fail="1" skip="0" id="s1-s1" name="Subtests 1">Sub-Tests.Subtests 1</stat>
<stat pass="2" fail="0" skip="0" id="s1-s2" name="Subtests 2">Sub-Tests.Subtests 2</stat>
</suite>
</statistics>
<errors>
</errors>
</robot>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "robotframework_id_in_name",
"name": "robotframework_id_in_name_RF50",
"suite_id": null,
"description": null,
"testsections": [
Expand Down Expand Up @@ -156,5 +156,5 @@
"properties": []
}
],
"source": "robotframework_id_in_name.xml"
"source": "robotframework_id_in_name_RF50.xml"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "robotframework_id_in_property",
"name": "robotframework_id_in_name_RF70",
"suite_id": null,
"description": null,
"testsections": [
Expand Down Expand Up @@ -156,5 +156,5 @@
"properties": []
}
],
"source": "robotframework_id_in_property.xml"
"source": "robotframework_id_in_name_RF70.xml"
}
Loading

0 comments on commit dd267ee

Please sign in to comment.