Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 98e1149

Browse files
committed
TM4J-6802: update documentation to use https://github.com/rikerfi/robotframework-xunitmodifier to generate files that are supported by ZephyrScale (containing testsuites)
1 parent 1807de7 commit 98e1149

File tree

4 files changed

+203
-3
lines changed

4 files changed

+203
-3
lines changed

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,40 @@ robot -x junitresult.xml mytest.robot
1616

1717
The command line above will execute the `mytest.robot` test file and generate the JUnit XML results file `junitresult.xml`. Then, this file containing the test results can be uploaded to Zephyr Scale using the following API endpoint: [`POST /automations/executions/junit`](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#operation/createJUnitExecutions).
1818

19-
The abovementioned API accepts either a single XML file as well as a .zip file containing multiple XML files. The POST request will create a new test cycle in Zephyr Scale containing the results and will respond with the key of the created test cycle.
19+
The above mentioned API accepts either a single XML file as well as a .zip file containing multiple XML files. The POST request will create a new test cycle in Zephyr Scale containing the results and will respond with the key of the created test cycle.
2020

21+
### One file containing multiple test-suites
22+
23+
Zephyr Scale does support having more than one testsuite in the same xml file, but RobotFramework is generating them
24+
in a way Zephyr Scale is not supporting:
25+
```
26+
<testsuite>
27+
<testsuite>
28+
....
29+
</testsuite>
30+
</testsuite>
31+
```
32+
33+
To generate files with multiple test suites at the same time, Zephyr Scale supports the following structure:
34+
```
35+
<testsuites>
36+
<testsuite>
37+
....
38+
</testsuite>
39+
</testsuites>
40+
```
41+
42+
There is already a Robot Framework's XUnit Output Modifier (xom) https://github.com/rikerfi/robotframework-xunitmodifier
43+
To use it, one of the options is to copy the file xom.py in the directory you are running your scripts.
44+
Edit the content of xom.py file by changing `ROOT_NODE_PLURAL` to:
45+
```
46+
ROOT_NODE_PLURAL = True
47+
```
48+
and if you want to run all robot frameworks inside your folder tests then you can run the following command:
49+
```
50+
robot --pythonpath . --prerebotmodifier xom.XUnitOut:xunit.xml tests
51+
```
52+
This command generates xunit.xml file compatible with Zephyr Scale.
2153
## Naming conventions
2254

2355
There are 2 ways to link Robot Framework test cases with Zephyr Scale test cases:
@@ -61,8 +93,8 @@ In order to execute this example on your local machine you will have to checkout
6193

6294
```
6395
brew upgrade pyenv
64-
pyenv install 3.6.0
65-
pyenv global 3.6.0
96+
pyenv install 3.8.13
97+
pyenv global 3.8.13
6698
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
6799
source ~/.zshrc
68100
```

tests/calculator.robot

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
*** Test Cases ***
3+
# will match Zephyr Scale test case named Calculator.User can clear the display
4+
User can clear the display
5+
Input number 10
6+
Press operator +
7+
Input number 1
8+
Press clear
9+
Display should be empty
10+
11+
*** Test Cases ***
12+
# will match Zephyr Scale test case with key VIC-T14
13+
VIC-T9 User can calculate with wrong result
14+
Input number 1
15+
Press operator +
16+
Input number 1
17+
Press enter
18+
Result should be 3
19+
20+
*** Test Cases ***
21+
# will match Zephyr Scale test case with key VIC-T9
22+
User can calculate two numbers - VIC-T9
23+
[Template] Calculate two numbers should pass
24+
10 + 5 15
25+
10 - 5 5
26+
10 / 5 2
27+
10 * 5 50
28+
29+
30+
*** Keywords ***
31+
Calculate two numbers should pass
32+
[Arguments] ${number1} ${operator} ${number2} ${result}
33+
Input number ${number1}
34+
Press operator ${operator}
35+
Input number ${number2}
36+
Press enter
37+
Result should be ${result}
38+
39+
Press enter
40+
Calculate
41+
42+
Press clear
43+
Clear
44+
45+
Clear Calculator
46+
Clear
47+
48+
49+
*** Settings ***
50+
Library app/Calculator.py
51+
52+
53+
*** Settings ***
54+
Suite Setup Clear Calculator
55+
Test Teardown Clear Calculator
56+

tests/calculator2.robot

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
*** Test Cases ***
3+
# will match Zephyr Scale test case named Calculator.User can clear the display
4+
User can clear the display
5+
Input number 10
6+
Press operator +
7+
Input number 1
8+
Press clear
9+
Display should be empty
10+
11+
*** Test Cases ***
12+
# will match Zephyr Scale test case with key VIC-T14
13+
VIC-T9 User can calculate with wrong result
14+
Input number 1
15+
Press operator +
16+
Input number 1
17+
Press enter
18+
Result should be 3
19+
20+
*** Test Cases ***
21+
# will match Zephyr Scale test case with key VIC-T9
22+
User can calculate two numbers - VIC-T9
23+
[Template] Calculate two numbers should pass
24+
10 + 5 15
25+
10 - 5 5
26+
10 / 5 2
27+
10 * 5 50
28+
29+
30+
*** Keywords ***
31+
Calculate two numbers should pass
32+
[Arguments] ${number1} ${operator} ${number2} ${result}
33+
Input number ${number1}
34+
Press operator ${operator}
35+
Input number ${number2}
36+
Press enter
37+
Result should be ${result}
38+
39+
Press enter
40+
Calculate
41+
42+
Press clear
43+
Clear
44+
45+
Clear Calculator
46+
Clear
47+
48+
49+
*** Settings ***
50+
Library app/Calculator.py
51+
52+
53+
*** Settings ***
54+
Suite Setup Clear Calculator
55+
Test Teardown Clear Calculator
56+

tests/calculator3.robot

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
*** Test Cases ***
3+
# will match Zephyr Scale test case named Calculator.User can clear the display
4+
User can clear the display
5+
Input number 10
6+
Press operator +
7+
Input number 1
8+
Press clear
9+
Display should be empty
10+
11+
*** Test Cases ***
12+
# will match Zephyr Scale test case with key VIC-T14
13+
VIC-T9 User can calculate with wrong result
14+
Input number 1
15+
Press operator +
16+
Input number 1
17+
Press enter
18+
Result should be 3
19+
20+
*** Test Cases ***
21+
# will match Zephyr Scale test case with key VIC-T9
22+
User can calculate two numbers - VIC-T9
23+
[Template] Calculate two numbers should pass
24+
10 + 5 15
25+
10 - 5 5
26+
10 / 5 2
27+
10 * 5 50
28+
29+
30+
*** Keywords ***
31+
Calculate two numbers should pass
32+
[Arguments] ${number1} ${operator} ${number2} ${result}
33+
Input number ${number1}
34+
Press operator ${operator}
35+
Input number ${number2}
36+
Press enter
37+
Result should be ${result}
38+
39+
Press enter
40+
Calculate
41+
42+
Press clear
43+
Clear
44+
45+
Clear Calculator
46+
Clear
47+
48+
49+
*** Settings ***
50+
Library app/Calculator.py
51+
52+
53+
*** Settings ***
54+
Suite Setup Clear Calculator
55+
Test Teardown Clear Calculator
56+

0 commit comments

Comments
 (0)