Fixed a bug regarding JUnit time field

Этот коммит содержится в:
Fredrik Lönnblad 2020-02-26 16:15:39 -03:00
родитель 4267df0fa9
коммит 1a35035f3e
5 изменённых файлов: 145 добавлений и 146 удалений

Просмотреть файл

@ -14,9 +14,9 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0">
<testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0">
<testcase name="simple scenario" status="" time="0s"></testcase> <testcase name="simple scenario" status="" time="0"></testcase>
</testsuite> </testsuite>
</testsuites> </testsuites>
""" """
@ -35,9 +35,9 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0">
<testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0">
<testcase name="simple scenario" status="" time="0s"></testcase> <testcase name="simple scenario" status="" time="0"></testcase>
</testsuite> </testsuite>
</testsuites> </testsuites>
""" """
@ -59,10 +59,10 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="2" skipped="0" failures="0" errors="0" time="0s"> <testsuites name="godog" tests="2" skipped="0" failures="0" errors="0" time="0">
<testsuite name="simple feature" tests="2" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="simple feature" tests="2" skipped="0" failures="0" errors="0" time="0">
<testcase name="simple scenario #1" status="" time="0s"></testcase> <testcase name="simple scenario #1" status="" time="0"></testcase>
<testcase name="simple scenario #2" status="" time="0s"></testcase> <testcase name="simple scenario #2" status="" time="0"></testcase>
</testsuite> </testsuite>
</testsuites> </testsuites>
""" """
@ -88,10 +88,10 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="2" skipped="0" failures="0" errors="0" time="0s"> <testsuites name="godog" tests="2" skipped="0" failures="0" errors="0" time="0">
<testsuite name="simple feature" tests="2" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="simple feature" tests="2" skipped="0" failures="0" errors="0" time="0">
<testcase name="simple scenario #1" status="" time="0s"></testcase> <testcase name="simple scenario #1" status="" time="0"></testcase>
<testcase name="simple scenario #2" status="" time="0s"></testcase> <testcase name="simple scenario #2" status="" time="0"></testcase>
</testsuite> </testsuite>
</testsuites> </testsuites>
""" """
@ -112,9 +112,9 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="1" skipped="0" failures="1" errors="0" time="0s"> <testsuites name="godog" tests="1" skipped="0" failures="1" errors="0" time="0">
<testsuite name="simple feature" tests="1" skipped="0" failures="1" errors="0" time="0s"> <testsuite name="simple feature" tests="1" skipped="0" failures="1" errors="0" time="0">
<testcase name="simple scenario" status="failed" time="0s"> <testcase name="simple scenario" status="failed" time="0">
<failure message="Step a failing step: intentional failure"></failure> <failure message="Step a failing step: intentional failure"></failure>
</testcase> </testcase>
</testsuite> </testsuite>
@ -141,10 +141,10 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="2" skipped="0" failures="1" errors="0" time="0s"> <testsuites name="godog" tests="2" skipped="0" failures="1" errors="0" time="0">
<testsuite name="simple feature" tests="2" skipped="0" failures="1" errors="0" time="0s"> <testsuite name="simple feature" tests="2" skipped="0" failures="1" errors="0" time="0">
<testcase name="simple scenario #1" status="passed" time="0s"></testcase> <testcase name="simple scenario #1" status="passed" time="0"></testcase>
<testcase name="simple scenario #2" status="failed" time="0s"> <testcase name="simple scenario #2" status="failed" time="0">
<failure message="Step failing step: intentional failure"></failure> <failure message="Step failing step: intentional failure"></failure>
</testcase> </testcase>
</testsuite> </testsuite>
@ -167,9 +167,9 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0">
<testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0">
<testcase name="simple scenario" status="" time="0s"></testcase> <testcase name="simple scenario" status="" time="0"></testcase>
</testsuite> </testsuite>
</testsuites> </testsuites>
""" """
@ -191,9 +191,9 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuites name="godog" tests="1" skipped="0" failures="0" errors="0" time="0">
<testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="0" time="0">
<testcase name="simple scenario" status="passed" time="0s"></testcase> <testcase name="simple scenario" status="passed" time="0"></testcase>
</testsuite> </testsuite>
</testsuites> </testsuites>
""" """
@ -216,9 +216,9 @@ Feature: JUnit XML formatter
Then the rendered xml will be as follows: Then the rendered xml will be as follows:
""" application/xml """ application/xml
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="godog" tests="1" skipped="0" failures="0" errors="1" time="0s"> <testsuites name="godog" tests="1" skipped="0" failures="0" errors="1" time="0">
<testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="1" time="0s"> <testsuite name="simple feature" tests="1" skipped="0" failures="0" errors="1" time="0">
<testcase name="simple scenario" status="undefined" time="0s"> <testcase name="simple scenario" status="undefined" time="0">
<error message="Step pending step: TODO: write pending definition" type="pending"></error> <error message="Step pending step: TODO: write pending definition" type="pending"></error>
<error message="Step undefined" type="undefined"></error> <error message="Step undefined" type="undefined"></error>
<error message="Step passing step" type="skipped"></error> <error message="Step passing step" type="skipped"></error>

Просмотреть файл

@ -1624,7 +1624,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 14, "line": 14,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 15 "line": 15
}, },
@ -1680,7 +1680,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 35, "line": 35,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 36 "line": 36
}, },
@ -1736,7 +1736,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 59, "line": 59,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"2\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"2\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario #1\" status=\"\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003ctestcase name=\"simple scenario #2\" status=\"\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"2\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"2\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario #1\" status=\"\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003ctestcase name=\"simple scenario #2\" status=\"\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 60 "line": 60
}, },
@ -1792,7 +1792,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 88, "line": 88,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"2\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"2\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario #1\" status=\"\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003ctestcase name=\"simple scenario #2\" status=\"\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"2\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"2\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario #1\" status=\"\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003ctestcase name=\"simple scenario #2\" status=\"\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 89 "line": 89
}, },
@ -1848,7 +1848,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 112, "line": 112,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"1\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"1\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"failed\" time=\"0s\"\u003e\n \u003cfailure message=\"Step a failing step: intentional failure\"\u003e\u003c/failure\u003e\n \u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"1\" errors=\"0\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"1\" errors=\"0\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"failed\" time=\"0\"\u003e\n \u003cfailure message=\"Step a failing step: intentional failure\"\u003e\u003c/failure\u003e\n \u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 113 "line": 113
}, },
@ -1904,7 +1904,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 141, "line": 141,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"2\" skipped=\"0\" failures=\"1\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"2\" skipped=\"0\" failures=\"1\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario #1\" status=\"passed\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003ctestcase name=\"simple scenario #2\" status=\"failed\" time=\"0s\"\u003e\n \u003cfailure message=\"Step failing step: intentional failure\"\u003e\u003c/failure\u003e\n \u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"2\" skipped=\"0\" failures=\"1\" errors=\"0\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"2\" skipped=\"0\" failures=\"1\" errors=\"0\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario #1\" status=\"passed\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003ctestcase name=\"simple scenario #2\" status=\"failed\" time=\"0\"\u003e\n \u003cfailure message=\"Step failing step: intentional failure\"\u003e\u003c/failure\u003e\n \u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 142 "line": 142
}, },
@ -1960,7 +1960,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 167, "line": 167,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 168 "line": 168
}, },
@ -2016,7 +2016,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 191, "line": 191,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"passed\" time=\"0s\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"0\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"passed\" time=\"0\"\u003e\u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 192 "line": 192
}, },
@ -2072,7 +2072,7 @@
"name": "the rendered xml will be as follows:", "name": "the rendered xml will be as follows:",
"line": 216, "line": 216,
"doc_string": { "doc_string": {
"value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"1\" time=\"0s\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"1\" time=\"0s\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"undefined\" time=\"0s\"\u003e\n \u003cerror message=\"Step pending step: TODO: write pending definition\" type=\"pending\"\u003e\u003c/error\u003e\n \u003cerror message=\"Step undefined\" type=\"undefined\"\u003e\u003c/error\u003e\n \u003cerror message=\"Step passing step\" type=\"skipped\"\u003e\u003c/error\u003e\n \u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e", "value": " \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n \u003ctestsuites name=\"godog\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"1\" time=\"0\"\u003e\n \u003ctestsuite name=\"simple feature\" tests=\"1\" skipped=\"0\" failures=\"0\" errors=\"1\" time=\"0\"\u003e\n \u003ctestcase name=\"simple scenario\" status=\"undefined\" time=\"0\"\u003e\n \u003cerror message=\"Step pending step: TODO: write pending definition\" type=\"pending\"\u003e\u003c/error\u003e\n \u003cerror message=\"Step undefined\" type=\"undefined\"\u003e\u003c/error\u003e\n \u003cerror message=\"Step passing step\" type=\"skipped\"\u003e\u003c/error\u003e\n \u003c/testcase\u003e\n \u003c/testsuite\u003e\n \u003c/testsuites\u003e",
"content_type": "application/xml", "content_type": "application/xml",
"line": 217 "line": 217
}, },

Просмотреть файл

@ -1,107 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites name="succeed" tests="78" skipped="0" failures="0" errors="0" time="0s"> <testsuites name="succeed" tests="78" skipped="0" failures="0" errors="0" time="0">
<testsuite name="JUnit XML formatter" tests="9" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="JUnit XML formatter" tests="9" skipped="0" failures="0" errors="0" time="0">
<testcase name="Support of Feature Plus Scenario Node" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Node" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Node With Tags" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Node With Tags" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline With Tags" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline With Tags" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario With Steps" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario With Steps" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline With Steps" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline With Steps" status="passed" time="0"></testcase>
<testcase name="Support of Comments" status="passed" time="0s"></testcase> <testcase name="Support of Comments" status="passed" time="0"></testcase>
<testcase name="Support of Docstrings" status="passed" time="0s"></testcase> <testcase name="Support of Docstrings" status="passed" time="0"></testcase>
<testcase name="Support of Undefined, Pending and Skipped status" status="passed" time="0s"></testcase> <testcase name="Support of Undefined, Pending and Skipped status" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="cucumber json formatter" tests="9" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="cucumber json formatter" tests="9" skipped="0" failures="0" errors="0" time="0">
<testcase name="Support of Feature Plus Scenario Node" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Node" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Node With Tags" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Node With Tags" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline With Tags" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline With Tags" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario With Steps" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario With Steps" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline With Steps" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline With Steps" status="passed" time="0"></testcase>
<testcase name="Support of Comments" status="passed" time="0s"></testcase> <testcase name="Support of Comments" status="passed" time="0"></testcase>
<testcase name="Support of Docstrings" status="passed" time="0s"></testcase> <testcase name="Support of Docstrings" status="passed" time="0"></testcase>
<testcase name="Support of Undefined, Pending and Skipped status" status="passed" time="0s"></testcase> <testcase name="Support of Undefined, Pending and Skipped status" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="event stream formatter" tests="3" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="event stream formatter" tests="3" skipped="0" failures="0" errors="0" time="0">
<testcase name="should fire only suite events without any scenario" status="passed" time="0s"></testcase> <testcase name="should fire only suite events without any scenario" status="passed" time="0"></testcase>
<testcase name="should process simple scenario" status="passed" time="0s"></testcase> <testcase name="should process simple scenario" status="passed" time="0"></testcase>
<testcase name="should process outline scenario" status="passed" time="0s"></testcase> <testcase name="should process outline scenario" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="load features" tests="6" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="load features" tests="6" skipped="0" failures="0" errors="0" time="0">
<testcase name="load features within path" status="passed" time="0s"></testcase> <testcase name="load features within path" status="passed" time="0"></testcase>
<testcase name="load a specific feature file" status="passed" time="0s"></testcase> <testcase name="load a specific feature file" status="passed" time="0"></testcase>
<testcase name="loaded feature should have a number of scenarios #1" status="passed" time="0s"></testcase> <testcase name="loaded feature should have a number of scenarios #1" status="passed" time="0"></testcase>
<testcase name="loaded feature should have a number of scenarios #2" status="passed" time="0s"></testcase> <testcase name="loaded feature should have a number of scenarios #2" status="passed" time="0"></testcase>
<testcase name="loaded feature should have a number of scenarios #3" status="passed" time="0s"></testcase> <testcase name="loaded feature should have a number of scenarios #3" status="passed" time="0"></testcase>
<testcase name="load a number of feature files" status="passed" time="0s"></testcase> <testcase name="load a number of feature files" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="pretty formatter" tests="9" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="pretty formatter" tests="9" skipped="0" failures="0" errors="0" time="0">
<testcase name="Support of Feature Plus Scenario Node" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Node" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Node With Tags" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Node With Tags" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline With Tags" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline With Tags" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario With Steps" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario With Steps" status="passed" time="0"></testcase>
<testcase name="Support of Feature Plus Scenario Outline With Steps" status="passed" time="0s"></testcase> <testcase name="Support of Feature Plus Scenario Outline With Steps" status="passed" time="0"></testcase>
<testcase name="Support of Comments" status="passed" time="0s"></testcase> <testcase name="Support of Comments" status="passed" time="0"></testcase>
<testcase name="Support of Docstrings" status="passed" time="0s"></testcase> <testcase name="Support of Docstrings" status="passed" time="0"></testcase>
<testcase name="Support of Undefined, Pending and Skipped status" status="passed" time="0s"></testcase> <testcase name="Support of Undefined, Pending and Skipped status" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="run background" tests="3" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="run background" tests="3" skipped="0" failures="0" errors="0" time="0">
<testcase name="should run background steps" status="passed" time="0s"></testcase> <testcase name="should run background steps" status="passed" time="0"></testcase>
<testcase name="should skip all consequent steps on failure" status="passed" time="0s"></testcase> <testcase name="should skip all consequent steps on failure" status="passed" time="0"></testcase>
<testcase name="should continue undefined steps" status="passed" time="0s"></testcase> <testcase name="should continue undefined steps" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="run features" tests="11" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="run features" tests="11" skipped="0" failures="0" errors="0" time="0">
<testcase name="should run a normal feature" status="passed" time="0s"></testcase> <testcase name="should run a normal feature" status="passed" time="0"></testcase>
<testcase name="should skip steps after failure" status="passed" time="0s"></testcase> <testcase name="should skip steps after failure" status="passed" time="0"></testcase>
<testcase name="should skip all scenarios if background fails" status="passed" time="0s"></testcase> <testcase name="should skip all scenarios if background fails" status="passed" time="0"></testcase>
<testcase name="should skip steps after undefined" status="passed" time="0s"></testcase> <testcase name="should skip steps after undefined" status="passed" time="0"></testcase>
<testcase name="should match undefined steps in a row" status="passed" time="0s"></testcase> <testcase name="should match undefined steps in a row" status="passed" time="0"></testcase>
<testcase name="should skip steps on pending" status="passed" time="0s"></testcase> <testcase name="should skip steps on pending" status="passed" time="0"></testcase>
<testcase name="should handle pending step" status="passed" time="0s"></testcase> <testcase name="should handle pending step" status="passed" time="0"></testcase>
<testcase name="should mark undefined steps after pending" status="passed" time="0s"></testcase> <testcase name="should mark undefined steps after pending" status="passed" time="0"></testcase>
<testcase name="should fail suite if undefined steps follow after the failure" status="passed" time="0s"></testcase> <testcase name="should fail suite if undefined steps follow after the failure" status="passed" time="0"></testcase>
<testcase name="should fail suite and skip pending step after failed step" status="passed" time="0s"></testcase> <testcase name="should fail suite and skip pending step after failed step" status="passed" time="0"></testcase>
<testcase name="should fail suite and skip next step after failed step" status="passed" time="0s"></testcase> <testcase name="should fail suite and skip next step after failed step" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="run features with nested steps" tests="6" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="run features with nested steps" tests="6" skipped="0" failures="0" errors="0" time="0">
<testcase name="should run passing multistep successfully" status="passed" time="0s"></testcase> <testcase name="should run passing multistep successfully" status="passed" time="0"></testcase>
<testcase name="should fail multistep" status="passed" time="0s"></testcase> <testcase name="should fail multistep" status="passed" time="0"></testcase>
<testcase name="should fail nested multistep" status="passed" time="0s"></testcase> <testcase name="should fail nested multistep" status="passed" time="0"></testcase>
<testcase name="should skip steps after undefined multistep" status="passed" time="0s"></testcase> <testcase name="should skip steps after undefined multistep" status="passed" time="0"></testcase>
<testcase name="should match undefined steps in a row" status="passed" time="0s"></testcase> <testcase name="should match undefined steps in a row" status="passed" time="0"></testcase>
<testcase name="should mark undefined steps after pending" status="passed" time="0s"></testcase> <testcase name="should mark undefined steps after pending" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="run outline" tests="6" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="run outline" tests="6" skipped="0" failures="0" errors="0" time="0">
<testcase name="should run a normal outline" status="passed" time="0s"></testcase> <testcase name="should run a normal outline" status="passed" time="0"></testcase>
<testcase name="should continue through examples on failure" status="passed" time="0s"></testcase> <testcase name="should continue through examples on failure" status="passed" time="0"></testcase>
<testcase name="should skip examples on background failure" status="passed" time="0s"></testcase> <testcase name="should skip examples on background failure" status="passed" time="0"></testcase>
<testcase name="should translate step table body" status="passed" time="0s"></testcase> <testcase name="should translate step table body" status="passed" time="0"></testcase>
<testcase name="should translate step doc string argument #1" status="passed" time="0s"></testcase> <testcase name="should translate step doc string argument #1" status="passed" time="0"></testcase>
<testcase name="should translate step doc string argument #2" status="passed" time="0s"></testcase> <testcase name="should translate step doc string argument #2" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="suite events" tests="6" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="suite events" tests="6" skipped="0" failures="0" errors="0" time="0">
<testcase name="triggers before scenario event" status="passed" time="0s"></testcase> <testcase name="triggers before scenario event" status="passed" time="0"></testcase>
<testcase name="triggers appropriate events for a single scenario" status="passed" time="0s"></testcase> <testcase name="triggers appropriate events for a single scenario" status="passed" time="0"></testcase>
<testcase name="triggers appropriate events whole feature" status="passed" time="0s"></testcase> <testcase name="triggers appropriate events whole feature" status="passed" time="0"></testcase>
<testcase name="triggers appropriate events for two feature files" status="passed" time="0s"></testcase> <testcase name="triggers appropriate events for two feature files" status="passed" time="0"></testcase>
<testcase name="should not trigger events on empty feature" status="passed" time="0s"></testcase> <testcase name="should not trigger events on empty feature" status="passed" time="0"></testcase>
<testcase name="should not trigger events on empty scenarios" status="passed" time="0s"></testcase> <testcase name="should not trigger events on empty scenarios" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="tag filters" tests="4" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="tag filters" tests="4" skipped="0" failures="0" errors="0" time="0">
<testcase name="should filter outline examples by tags" status="passed" time="0s"></testcase> <testcase name="should filter outline examples by tags" status="passed" time="0"></testcase>
<testcase name="should filter scenarios by X tag" status="passed" time="0s"></testcase> <testcase name="should filter scenarios by X tag" status="passed" time="0"></testcase>
<testcase name="should filter scenarios by X tag not having Y" status="passed" time="0s"></testcase> <testcase name="should filter scenarios by X tag not having Y" status="passed" time="0"></testcase>
<testcase name="should filter scenarios having Y and Z tags" status="passed" time="0s"></testcase> <testcase name="should filter scenarios having Y and Z tags" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="undefined step snippets" tests="5" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="undefined step snippets" tests="5" skipped="0" failures="0" errors="0" time="0">
<testcase name="should generate snippets" status="passed" time="0s"></testcase> <testcase name="should generate snippets" status="passed" time="0"></testcase>
<testcase name="should generate snippets with more arguments" status="passed" time="0s"></testcase> <testcase name="should generate snippets with more arguments" status="passed" time="0"></testcase>
<testcase name="should handle escaped symbols" status="passed" time="0s"></testcase> <testcase name="should handle escaped symbols" status="passed" time="0"></testcase>
<testcase name="should handle string argument followed by comma" status="passed" time="0s"></testcase> <testcase name="should handle string argument followed by comma" status="passed" time="0"></testcase>
<testcase name="should handle arguments in the beggining or end of the step" status="passed" time="0s"></testcase> <testcase name="should handle arguments in the beggining or end of the step" status="passed" time="0"></testcase>
</testsuite> </testsuite>
<testsuite name="užkrauti savybes" tests="1" skipped="0" failures="0" errors="0" time="0s"> <testsuite name="užkrauti savybes" tests="1" skipped="0" failures="0" errors="0" time="0">
<testcase name="savybių užkrovimas iš aplanko" status="passed" time="0s"></testcase> <testcase name="savybių užkrovimas iš aplanko" status="passed" time="0"></testcase>
</testsuite> </testsuite>
</testsuites> </testsuites>

Просмотреть файл

@ -123,7 +123,7 @@ func buildJUNITPackageSuite(suiteName string, startedAt time.Time, features []*f
suite := junitPackageSuite{ suite := junitPackageSuite{
Name: suiteName, Name: suiteName,
TestSuites: make([]*junitTestSuite, len(features)), TestSuites: make([]*junitTestSuite, len(features)),
Time: timeNowFunc().Sub(startedAt).String(), Time: fmt.Sprintf("%.f", timeNowFunc().Sub(startedAt).Seconds()),
} }
sort.Sort(sortByName(features)) sort.Sort(sortByName(features))
@ -131,14 +131,14 @@ func buildJUNITPackageSuite(suiteName string, startedAt time.Time, features []*f
for idx, feat := range features { for idx, feat := range features {
ts := junitTestSuite{ ts := junitTestSuite{
Name: feat.Name, Name: feat.Name,
Time: feat.finishedAt().Sub(feat.startedAt()).String(), Time: fmt.Sprintf("%.f", feat.finishedAt().Sub(feat.startedAt()).Seconds()),
TestCases: make([]*junitTestCase, len(feat.Scenarios)), TestCases: make([]*junitTestCase, len(feat.Scenarios)),
} }
for idx, scenario := range feat.Scenarios { for idx, scenario := range feat.Scenarios {
tc := junitTestCase{} tc := junitTestCase{}
tc.Name = scenario.Name tc.Name = scenario.Name
tc.Time = scenario.finishedAt().Sub(scenario.startedAt()).String() tc.Time = fmt.Sprintf("%.f", scenario.finishedAt().Sub(scenario.startedAt()).Seconds())
ts.Tests++ ts.Tests++
suite.Tests++ suite.Tests++

Просмотреть файл

@ -7,7 +7,6 @@ import (
"io" "io"
"strings" "strings"
"testing" "testing"
"time"
"github.com/cucumber/godog/colors" "github.com/cucumber/godog/colors"
"github.com/cucumber/godog/gherkin" "github.com/cucumber/godog/gherkin"
@ -70,31 +69,31 @@ func TestJUnitFormatterOutput(t *testing.T) {
s.Step(`^failing$`, func() error { return fmt.Errorf("errored") }) s.Step(`^failing$`, func() error { return fmt.Errorf("errored") })
s.Step(`^pending$`, func() error { return ErrPending }) s.Step(`^pending$`, func() error { return ErrPending })
var zeroDuration time.Duration const zeroDuration = "0"
expected := junitPackageSuite{ expected := junitPackageSuite{
Name: "junit", Name: "junit",
Tests: 8, Tests: 8,
Skipped: 0, Skipped: 0,
Failures: 2, Failures: 2,
Errors: 4, Errors: 4,
Time: zeroDuration.String(), Time: zeroDuration,
TestSuites: []*junitTestSuite{{ TestSuites: []*junitTestSuite{{
Name: "junit formatter", Name: "junit formatter",
Tests: 8, Tests: 8,
Skipped: 0, Skipped: 0,
Failures: 2, Failures: 2,
Errors: 4, Errors: 4,
Time: zeroDuration.String(), Time: zeroDuration,
TestCases: []*junitTestCase{ TestCases: []*junitTestCase{
{ {
Name: "passing scenario", Name: "passing scenario",
Status: "passed", Status: "passed",
Time: zeroDuration.String(), Time: zeroDuration,
}, },
{ {
Name: "failing scenario", Name: "failing scenario",
Status: "failed", Status: "failed",
Time: zeroDuration.String(), Time: zeroDuration,
Failure: &junitFailure{ Failure: &junitFailure{
Message: "Step failing: errored", Message: "Step failing: errored",
}, },
@ -105,7 +104,7 @@ func TestJUnitFormatterOutput(t *testing.T) {
{ {
Name: "pending scenario", Name: "pending scenario",
Status: "pending", Status: "pending",
Time: zeroDuration.String(), Time: zeroDuration,
Error: []*junitError{ Error: []*junitError{
{Message: "Step pending: TODO: write pending definition", Type: "pending"}, {Message: "Step pending: TODO: write pending definition", Type: "pending"},
{Message: "Step passing", Type: "skipped"}, {Message: "Step passing", Type: "skipped"},
@ -114,7 +113,7 @@ func TestJUnitFormatterOutput(t *testing.T) {
{ {
Name: "undefined scenario", Name: "undefined scenario",
Status: "undefined", Status: "undefined",
Time: zeroDuration.String(), Time: zeroDuration,
Error: []*junitError{ Error: []*junitError{
{Message: "Step undefined", Type: "undefined"}, {Message: "Step undefined", Type: "undefined"},
{Message: "Step next undefined", Type: "undefined"}, {Message: "Step next undefined", Type: "undefined"},
@ -123,12 +122,12 @@ func TestJUnitFormatterOutput(t *testing.T) {
{ {
Name: "outline #1", Name: "outline #1",
Status: "passed", Status: "passed",
Time: zeroDuration.String(), Time: zeroDuration,
}, },
{ {
Name: "outline #2", Name: "outline #2",
Status: "failed", Status: "failed",
Time: zeroDuration.String(), Time: zeroDuration,
Failure: &junitFailure{ Failure: &junitFailure{
Message: "Step failing: errored", Message: "Step failing: errored",
}, },
@ -136,7 +135,7 @@ func TestJUnitFormatterOutput(t *testing.T) {
{ {
Name: "outline #3", Name: "outline #3",
Status: "pending", Status: "pending",
Time: zeroDuration.String(), Time: zeroDuration,
Error: []*junitError{ Error: []*junitError{
{Message: "Step pending: TODO: write pending definition", Type: "pending"}, {Message: "Step pending: TODO: write pending definition", Type: "pending"},
}, },
@ -144,7 +143,7 @@ func TestJUnitFormatterOutput(t *testing.T) {
{ {
Name: "outline #4", Name: "outline #4",
Status: "undefined", Status: "undefined",
Time: zeroDuration.String(), Time: zeroDuration,
Error: []*junitError{ Error: []*junitError{
{Message: "Step undefined", Type: "undefined"}, {Message: "Step undefined", Type: "undefined"},
}, },