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

Commit d9b8f94

Browse files
TM4J-3469 Add README file
1 parent 1895049 commit d9b8f94

File tree

6 files changed

+125
-63
lines changed

6 files changed

+125
-63
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
# zephyr-scale-robot-framework-example
1+
# Example of how to use Robot Framework to generate JUnit result file
2+
3+
Small project to show how to make Robot Framework to generate the JUnit result file that you can [`POST /automations/executions/junit`](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#operation/createJUnitExecutions)
4+
5+
### How to generate the JUnit result files
6+
7+
You just have to execute Robot Framework with `-x` parameter followed by the xml result file name to instruct it to generate the JUnit result file. For testing purposes, you can clone this project and execute Robot Framework like so:
8+
9+
```
10+
robot -x junitresult.xml calculator.robot
11+
```
12+
13+
This will generate the JUnit result file `junitresult.xml` that you'll [`POST /automations/executions/junit`](https://support.smartbear.com/zephyr-scale-cloud/api-docs/#operation/createJUnitExecutions).

calculator.robot

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ User can clear the display
77
Press clear
88
Display should be empty
99

10+
*** Test Cases ***
11+
User can calculate with wrong result
12+
Input number 1
13+
Press operator +
14+
Input number 1
15+
Press enter
16+
Result should be 3
1017

1118
*** Test Cases ***
1219
User can calculate two numbers

junitresult.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<testsuite name="Calculator" tests="2" errors="0" failures="0" skipped="0" time="0.039">
3-
<testcase classname="Calculator" name="User can clear the display" time="0.003">
2+
<testsuite name="Calculator" tests="3" errors="0" failures="1" skipped="0" time="0.034">
3+
<testcase classname="Calculator" name="User can clear the display" time="0.002">
44
</testcase>
5-
<testcase classname="Calculator" name="User can calculate two numbers" time="0.009">
5+
<testcase classname="Calculator" name="User can clear the display by pressing enter" time="0.003">
6+
<failure message="Expected result to be '3' but was '2'." type="AssertionError"></failure>
7+
</testcase>
8+
<testcase classname="Calculator" name="User can calculate two numbers" time="0.008">
69
</testcase>
710
</testsuite>

log.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,31 +1750,31 @@
17501750
window.output = {};
17511751
</script>
17521752
<script type="text/javascript">
1753-
window.output["suite"] = [1,2,3,0,[],[1,0,39],[],[[4,0,1,0,[],[1,26,3],[[0,5,1,0,0,6,0,0,[1,27,0],[],[]],[0,7,1,0,0,8,0,0,[1,27,0],[],[]],[0,5,1,0,0,9,0,0,[1,27,0],[],[]],[0,10,0,0,0,0,0,0,[1,28,0],[[0,11,1,0,0,0,0,0,[1,28,0],[],[]]],[]],[0,12,1,0,0,0,0,0,[1,28,0],[],[]],[2,13,0,0,0,0,0,0,[1,28,1],[[0,11,1,0,0,0,0,0,[1,29,0],[],[]]],[]]]],[14,0,1,0,[],[1,29,9],[[0,15,0,0,0,16,0,0,[1,30,2],[[0,5,1,0,0,17,0,0,[1,30,0],[],[]],[0,7,1,0,0,18,0,0,[1,30,1],[],[]],[0,5,1,0,0,19,0,0,[1,31,0],[],[]],[0,20,0,0,0,0,0,0,[1,31,0],[[0,21,1,0,0,0,0,0,[1,31,0],[],[]]],[]],[0,22,1,0,0,23,0,0,[1,32,0],[],[]]],[]],[0,15,0,0,0,24,0,0,[1,32,2],[[0,5,1,0,0,17,0,0,[1,32,0],[],[]],[0,7,1,0,0,18,0,0,[1,32,1],[],[]],[0,5,1,0,0,19,0,0,[1,33,0],[],[]],[0,20,0,0,0,0,0,0,[1,33,1],[[0,21,1,0,0,0,0,0,[1,33,0],[],[]]],[]],[0,22,1,0,0,23,0,0,[1,34,0],[],[]]],[]],[0,15,0,0,0,25,0,0,[1,34,2],[[0,5,1,0,0,17,0,0,[1,34,1],[],[]],[0,7,1,0,0,18,0,0,[1,35,0],[],[]],[0,5,1,0,0,19,0,0,[1,35,0],[],[]],[0,20,0,0,0,0,0,0,[1,35,1],[[0,21,1,0,0,0,0,0,[1,35,0],[],[]]],[]],[0,22,1,0,0,23,0,0,[1,36,0],[],[]]],[]],[0,15,0,0,0,26,0,0,[1,36,2],[[0,5,1,0,0,17,0,0,[1,36,0],[],[]],[0,7,1,0,0,18,0,0,[1,37,0],[],[]],[0,5,1,0,0,19,0,0,[1,37,0],[],[]],[0,20,0,0,0,0,0,0,[1,37,0],[[0,21,1,0,0,0,0,0,[1,37,0],[],[]]],[]],[0,22,1,0,0,23,0,0,[1,37,1],[],[]]],[]],[2,13,0,0,0,0,0,0,[1,38,0],[[0,11,1,0,0,0,0,0,[1,38,0],[],[]]],[]]]]],[[1,13,0,0,0,0,0,0,[1,26,0],[[0,11,1,0,0,0,0,0,[1,26,0],[],[]]],[]]],[2,2,2,2]];
1753+
window.output["suite"] = [1,2,3,0,[],[0,0,34],[],[[4,0,1,0,[],[1,20,2],[[0,5,1,0,0,6,0,0,[1,20,0],[],[]],[0,7,1,0,0,8,0,0,[1,20,0],[],[]],[0,5,1,0,0,9,0,0,[1,20,0],[],[]],[0,10,0,0,0,0,0,0,[1,21,0],[[0,11,1,0,0,0,0,0,[1,21,0],[],[]]],[]],[0,12,1,0,0,0,0,0,[1,21,0],[],[]],[2,13,0,0,0,0,0,0,[1,21,1],[[0,11,1,0,0,0,0,0,[1,22,0],[],[]]],[]]]],[14,0,1,0,[],[0,22,3,15],[[0,5,1,0,0,9,0,0,[1,22,1],[],[]],[0,7,1,0,0,8,0,0,[1,23,0],[],[]],[0,5,1,0,0,9,0,0,[1,23,0],[],[]],[0,16,0,0,0,0,0,0,[1,23,0],[[0,17,1,0,0,0,0,0,[1,23,0],[],[]]],[]],[0,18,1,0,0,19,0,0,[0,24,1],[],[[25,5,15]]],[2,13,0,0,0,0,0,0,[1,25,0],[[0,11,1,0,0,0,0,0,[1,25,0],[],[]]],[]]]],[20,0,1,0,[],[1,26,8],[[0,21,0,0,0,22,0,0,[1,26,2],[[0,5,1,0,0,23,0,0,[1,26,1],[],[]],[0,7,1,0,0,24,0,0,[1,27,0],[],[]],[0,5,1,0,0,25,0,0,[1,27,0],[],[]],[0,16,0,0,0,0,0,0,[1,27,0],[[0,17,1,0,0,0,0,0,[1,27,0],[],[]]],[]],[0,18,1,0,0,26,0,0,[1,28,0],[],[]]],[]],[0,21,0,0,0,27,0,0,[1,28,1],[[0,5,1,0,0,23,0,0,[1,28,0],[],[]],[0,7,1,0,0,24,0,0,[1,28,1],[],[]],[0,5,1,0,0,25,0,0,[1,29,0],[],[]],[0,16,0,0,0,0,0,0,[1,29,0],[[0,17,1,0,0,0,0,0,[1,29,0],[],[]]],[]],[0,18,1,0,0,26,0,0,[1,29,0],[],[]]],[]],[0,21,0,0,0,28,0,0,[1,30,1],[[0,5,1,0,0,23,0,0,[1,30,0],[],[]],[0,7,1,0,0,24,0,0,[1,30,0],[],[]],[0,5,1,0,0,25,0,0,[1,30,0],[],[]],[0,16,0,0,0,0,0,0,[1,31,0],[[0,17,1,0,0,0,0,0,[1,31,0],[],[]]],[]],[0,18,1,0,0,26,0,0,[1,31,0],[],[]]],[]],[0,21,0,0,0,29,0,0,[1,31,2],[[0,5,1,0,0,23,0,0,[1,32,0],[],[]],[0,7,1,0,0,24,0,0,[1,32,0],[],[]],[0,5,1,0,0,25,0,0,[1,32,0],[],[]],[0,16,0,0,0,0,0,0,[1,32,1],[[0,17,1,0,0,0,0,0,[1,33,0],[],[]]],[]],[0,18,1,0,0,26,0,0,[1,33,0],[],[]]],[]],[2,13,0,0,0,0,0,0,[1,33,1],[[0,11,1,0,0,0,0,0,[1,33,1],[],[]]],[]]]]],[[1,13,0,0,0,0,0,0,[1,19,0],[[0,11,1,0,0,0,0,0,[1,19,0],[],[]]],[]]],[3,2,3,2]];
17541754
</script>
17551755
<script type="text/javascript">
17561756
window.output["strings"] = [];
17571757
</script>
17581758
<script type="text/javascript">
1759-
window.output["strings"] = window.output["strings"].concat(["*","*Calculator","*/Users/otaviomedeiros/SmartBear/Projects/zephyr-scale-robot-framework-example/calculator.robot","*calculator.robot","*User can clear the display","*Input Number","*10","*Press Operator","*+","*1","*Press clear","*Clear","*Display Should Be Empty","*Clear Calculator","*User can calculate two numbers","*Calculate two numbers should pass","*10, +, 5, 15","*${number1}","*${operator}","*${number2}","*Press enter","*Calculate","*Result Should Be","*${result}","*10, -, 5, 5","*10, /, 5, 2","*10, *, 5, 50"]);
1759+
window.output["strings"] = window.output["strings"].concat(["*","*Calculator","*/Users/otaviomedeiros/SmartBear/Projects/zephyr-scale-robot-framework-example/calculator.robot","*calculator.robot","*User can clear the display","*Input Number","*10","*Press Operator","*+","*1","*Press clear","*Clear","*Display Should Be Empty","*Clear Calculator","*User can clear the display by pressing enter","*Expected result to be '3' but was '2'.","*Press enter","*Calculate","*Result Should Be","*3","*User can calculate two numbers","*Calculate two numbers should pass","*10, +, 5, 15","*${number1}","*${operator}","*${number2}","*${result}","*10, -, 5, 5","*10, /, 5, 2","*10, *, 5, 50"]);
17601760
</script>
17611761
<script type="text/javascript">
1762-
window.output["stats"] = [[{"elapsed":"00:00:00","fail":0,"label":"Critical Tests","pass":2},{"elapsed":"00:00:00","fail":0,"label":"All Tests","pass":2}],[],[{"elapsed":"00:00:00","fail":0,"id":"s1","label":"Calculator","name":"Calculator","pass":2}]];
1762+
window.output["stats"] = [[{"elapsed":"00:00:00","fail":1,"label":"Critical Tests","pass":2},{"elapsed":"00:00:00","fail":1,"label":"All Tests","pass":2}],[],[{"elapsed":"00:00:00","fail":1,"id":"s1","label":"Calculator","name":"Calculator","pass":2}]];
17631763
</script>
17641764
<script type="text/javascript">
17651765
window.output["errors"] = [];
17661766
</script>
17671767
<script type="text/javascript">
1768-
window.output["baseMillis"] = 1613954944736;
1768+
window.output["baseMillis"] = 1614806086432;
17691769
</script>
17701770
<script type="text/javascript">
1771-
window.output["generated"] = 45;
1771+
window.output["generated"] = 40;
17721772
</script>
17731773
<script type="text/javascript">
17741774
window.output["expand_keywords"] = null;
17751775
</script>
17761776
<script type="text/javascript">
1777-
window.settings = {"defaultLevel":"INFO","minLevel":"NONE","reportURL":"report.html","rpa":false,"splitLogBase":"log","title":""};
1777+
window.settings = {"defaultLevel":"INFO","minLevel":"FAIL","reportURL":"report.html","rpa":false,"splitLogBase":"log","title":""};
17781778
</script>
17791779
<title></title>
17801780
</head>

0 commit comments

Comments
 (0)