Closed shubhamyannawar closed 6 years ago
I'm not sure I understand your question. You can run Serenity through the maven surefire plugin (or the failsafe plugin, which is more usual). When you run Serenity tests through surefire or failsafe, both surefire and Serenity reports will be generated.
Thank you for you response. I have executed through surefire plugin it has generated the surefire reports but its generating partial serenity reports .It has generated few html files but index.html is missing so not able to get full serenity reports.
You will need to call the aggregate maven goal, by running mvn serentity:aggreagate
executed clean verify serenity:aggregate surefire-report:report -Daggregate=true site -DgenerateReports=false command but not worked .
clean verify serenity:aggregate
should be enough. It is most likely an issue with your pom.xml file. Take a look at https://github.com/serenity-bdd/screenplay-pattern-todomvc/blob/master/pom.xml to see a working example.
Here is the pom.xml that I am using.
With clean verify serenity:aggregate its generating only serenity reports.
I have tried clean verify serenity:aggregate -Dmaven.test.failure.ignore=true surefire-report:report -Daggregate=true site -DgenerateReports=false
with this command both surefire and serenity reports are generated but it has executed the test cases two times , Looking for the way by which I can generate both reports on single run
You will need to use the failsafe plugin rather than the surefire plugin to always get the aggregate reports generated.
Closing this for lack of activity.
@wakaleo , is Serenity report generation still exclusive to the failsafe plugin? Or is there maybe some recommended hack to get it to work with surefire? I'm asking because I'm trying out TM4J which only works with the surefire plugin, so it would be quite neat to get reports with surefire as well.
It’s just a Maven plugin, you can integrate it anywhere you want. But surefire will make it harder to automatically generate the reports.
Wow, thanks for the speedy reply! In case someone else has the same issue: Right now report generation seems to work with running tests via surefire as long as I use the execution phase "test" for the serenity-maven-plugin and explicitly trigger it using "serenity:aggregate" in the command line. I'll take wakaleo's reply to indicate that this is not guaranteed to work under all circumstances :) .
Yes, that’s how the test lifecycle phase works in Maven
While I've got you: Could you elaborate a bit more on "surefire will make it harder to automatically generate the reports"? What does that depend on? Thank you in advance!
I am working on serenity but I want reports with both serenity and surefire .But when I am executing the test suit the suit get executed separately once for serenity and once for surefire and then I got the reports from both serenity and surefire. But I want reports generated for both serenity and surefire on single go. Is there any way to do so? Please help regarding this