Customize XML report files in Spock
up vote
1
down vote
favorite
I am new to Spock and need to figure out if I can customize the XML test report file generated by Spock. As far as I could figure out so far, I can enable generating JSON report file in which I would have access to all tests' start and end time.
I have integrated Spock with Jenkins and I am able to see the generated test reports after each build. I am wondering if there is a way by which I can customize this report to include start and end time?
Is there any way by which I can
- include my own defined parameters into the test results
- have Jenkins to show also my defined parameters in the report
Here is an example of what I want to have
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="SpecName" tests="12" skipped="0" failures="2" errors="0" timestamp="2018-16-15T09:12:59" hostname="DESKTOP-VANP1TU" time="0.864">
<properties/>
<testcase name="FeatureName" classname="SpecName" time="0.116" startTime="2018-16-15T09:12:59" endTime="2018-16-15T09:12:59"/>
.
.
.
</testsuite>
As you can see I have added two fields (StartTime and endTime) to the report.
jenkins groovy junit spock spock-reports
add a comment |
up vote
1
down vote
favorite
I am new to Spock and need to figure out if I can customize the XML test report file generated by Spock. As far as I could figure out so far, I can enable generating JSON report file in which I would have access to all tests' start and end time.
I have integrated Spock with Jenkins and I am able to see the generated test reports after each build. I am wondering if there is a way by which I can customize this report to include start and end time?
Is there any way by which I can
- include my own defined parameters into the test results
- have Jenkins to show also my defined parameters in the report
Here is an example of what I want to have
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="SpecName" tests="12" skipped="0" failures="2" errors="0" timestamp="2018-16-15T09:12:59" hostname="DESKTOP-VANP1TU" time="0.864">
<properties/>
<testcase name="FeatureName" classname="SpecName" time="0.116" startTime="2018-16-15T09:12:59" endTime="2018-16-15T09:12:59"/>
.
.
.
</testsuite>
As you can see I have added two fields (StartTime and endTime) to the report.
jenkins groovy junit spock spock-reports
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am new to Spock and need to figure out if I can customize the XML test report file generated by Spock. As far as I could figure out so far, I can enable generating JSON report file in which I would have access to all tests' start and end time.
I have integrated Spock with Jenkins and I am able to see the generated test reports after each build. I am wondering if there is a way by which I can customize this report to include start and end time?
Is there any way by which I can
- include my own defined parameters into the test results
- have Jenkins to show also my defined parameters in the report
Here is an example of what I want to have
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="SpecName" tests="12" skipped="0" failures="2" errors="0" timestamp="2018-16-15T09:12:59" hostname="DESKTOP-VANP1TU" time="0.864">
<properties/>
<testcase name="FeatureName" classname="SpecName" time="0.116" startTime="2018-16-15T09:12:59" endTime="2018-16-15T09:12:59"/>
.
.
.
</testsuite>
As you can see I have added two fields (StartTime and endTime) to the report.
jenkins groovy junit spock spock-reports
I am new to Spock and need to figure out if I can customize the XML test report file generated by Spock. As far as I could figure out so far, I can enable generating JSON report file in which I would have access to all tests' start and end time.
I have integrated Spock with Jenkins and I am able to see the generated test reports after each build. I am wondering if there is a way by which I can customize this report to include start and end time?
Is there any way by which I can
- include my own defined parameters into the test results
- have Jenkins to show also my defined parameters in the report
Here is an example of what I want to have
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="SpecName" tests="12" skipped="0" failures="2" errors="0" timestamp="2018-16-15T09:12:59" hostname="DESKTOP-VANP1TU" time="0.864">
<properties/>
<testcase name="FeatureName" classname="SpecName" time="0.116" startTime="2018-16-15T09:12:59" endTime="2018-16-15T09:12:59"/>
.
.
.
</testsuite>
As you can see I have added two fields (StartTime and endTime) to the report.
jenkins groovy junit spock spock-reports
jenkins groovy junit spock spock-reports
edited Nov 16 at 15:07
asked Nov 5 at 17:06
Suo6613
132112
132112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
the spock reports extension lets you define templates for your reports: https://github.com/renatoathaydes/spock-reports
with that at hand, you should also be able to define an XML template...
Thanks - do you know where I can read a bit more on this? I cannot figure out how to override the default XML template!
– Suo6613
Nov 14 at 17:43
have you already checked out this readme? github.com/renatoathaydes/spock-reports/blob/master/README.md ? You have to configure a custom html report which creates your xml...
– rdmueller
Nov 15 at 6:45
I have gone through this file but unfortunately I couldn't figure out how to get access to some fields like "start time" or "end time" of the execution of each feature! Like what I see in the JSON format report.
– Suo6613
Nov 15 at 20:46
do you have an example of the xml report you need?
– rdmueller
Nov 16 at 5:20
I just edited my question and added an example.
– Suo6613
Nov 16 at 15:07
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
the spock reports extension lets you define templates for your reports: https://github.com/renatoathaydes/spock-reports
with that at hand, you should also be able to define an XML template...
Thanks - do you know where I can read a bit more on this? I cannot figure out how to override the default XML template!
– Suo6613
Nov 14 at 17:43
have you already checked out this readme? github.com/renatoathaydes/spock-reports/blob/master/README.md ? You have to configure a custom html report which creates your xml...
– rdmueller
Nov 15 at 6:45
I have gone through this file but unfortunately I couldn't figure out how to get access to some fields like "start time" or "end time" of the execution of each feature! Like what I see in the JSON format report.
– Suo6613
Nov 15 at 20:46
do you have an example of the xml report you need?
– rdmueller
Nov 16 at 5:20
I just edited my question and added an example.
– Suo6613
Nov 16 at 15:07
add a comment |
up vote
0
down vote
the spock reports extension lets you define templates for your reports: https://github.com/renatoathaydes/spock-reports
with that at hand, you should also be able to define an XML template...
Thanks - do you know where I can read a bit more on this? I cannot figure out how to override the default XML template!
– Suo6613
Nov 14 at 17:43
have you already checked out this readme? github.com/renatoathaydes/spock-reports/blob/master/README.md ? You have to configure a custom html report which creates your xml...
– rdmueller
Nov 15 at 6:45
I have gone through this file but unfortunately I couldn't figure out how to get access to some fields like "start time" or "end time" of the execution of each feature! Like what I see in the JSON format report.
– Suo6613
Nov 15 at 20:46
do you have an example of the xml report you need?
– rdmueller
Nov 16 at 5:20
I just edited my question and added an example.
– Suo6613
Nov 16 at 15:07
add a comment |
up vote
0
down vote
up vote
0
down vote
the spock reports extension lets you define templates for your reports: https://github.com/renatoathaydes/spock-reports
with that at hand, you should also be able to define an XML template...
the spock reports extension lets you define templates for your reports: https://github.com/renatoathaydes/spock-reports
with that at hand, you should also be able to define an XML template...
answered Nov 10 at 7:11
rdmueller
6,683748100
6,683748100
Thanks - do you know where I can read a bit more on this? I cannot figure out how to override the default XML template!
– Suo6613
Nov 14 at 17:43
have you already checked out this readme? github.com/renatoathaydes/spock-reports/blob/master/README.md ? You have to configure a custom html report which creates your xml...
– rdmueller
Nov 15 at 6:45
I have gone through this file but unfortunately I couldn't figure out how to get access to some fields like "start time" or "end time" of the execution of each feature! Like what I see in the JSON format report.
– Suo6613
Nov 15 at 20:46
do you have an example of the xml report you need?
– rdmueller
Nov 16 at 5:20
I just edited my question and added an example.
– Suo6613
Nov 16 at 15:07
add a comment |
Thanks - do you know where I can read a bit more on this? I cannot figure out how to override the default XML template!
– Suo6613
Nov 14 at 17:43
have you already checked out this readme? github.com/renatoathaydes/spock-reports/blob/master/README.md ? You have to configure a custom html report which creates your xml...
– rdmueller
Nov 15 at 6:45
I have gone through this file but unfortunately I couldn't figure out how to get access to some fields like "start time" or "end time" of the execution of each feature! Like what I see in the JSON format report.
– Suo6613
Nov 15 at 20:46
do you have an example of the xml report you need?
– rdmueller
Nov 16 at 5:20
I just edited my question and added an example.
– Suo6613
Nov 16 at 15:07
Thanks - do you know where I can read a bit more on this? I cannot figure out how to override the default XML template!
– Suo6613
Nov 14 at 17:43
Thanks - do you know where I can read a bit more on this? I cannot figure out how to override the default XML template!
– Suo6613
Nov 14 at 17:43
have you already checked out this readme? github.com/renatoathaydes/spock-reports/blob/master/README.md ? You have to configure a custom html report which creates your xml...
– rdmueller
Nov 15 at 6:45
have you already checked out this readme? github.com/renatoathaydes/spock-reports/blob/master/README.md ? You have to configure a custom html report which creates your xml...
– rdmueller
Nov 15 at 6:45
I have gone through this file but unfortunately I couldn't figure out how to get access to some fields like "start time" or "end time" of the execution of each feature! Like what I see in the JSON format report.
– Suo6613
Nov 15 at 20:46
I have gone through this file but unfortunately I couldn't figure out how to get access to some fields like "start time" or "end time" of the execution of each feature! Like what I see in the JSON format report.
– Suo6613
Nov 15 at 20:46
do you have an example of the xml report you need?
– rdmueller
Nov 16 at 5:20
do you have an example of the xml report you need?
– rdmueller
Nov 16 at 5:20
I just edited my question and added an example.
– Suo6613
Nov 16 at 15:07
I just edited my question and added an example.
– Suo6613
Nov 16 at 15:07
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53158991%2fcustomize-xml-report-files-in-spock%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown