how to store serenity reports in new folder with timestamp(folderName-timestamp) when maven is build

1,520 views
Skip to first unread message

pg12...@gmail.com

unread,
Aug 26, 2017, 2:20:16 PM8/26/17
to Serenity BDD Users Group
how to automatically store serenity-bdd reports in new folder with timestamp (e.g.: folder_name-timestamp) when I build maven project each time?

I want to achieve this: whenever I build the maven project, a new folder with timestamp (e.g.: folder_name-timestamp) should get created & the reports should get automatically stored in the newly created folder. In serenity.properties file, we can give "serenity.outputDirectory" property to configure the new path & folder to store reports. But how to append that folder name with timestamp automatically?

John Smart

unread,
Aug 27, 2017, 2:32:40 AM8/27/17
to Serenity BDD Users Group, pg12...@gmail.com
You would do this at a separate Gradle or Maven step, or as part of your CI build - it is not in the scope of Serenity as such.

On Sat, 26 Aug 2017 at 19:20, <pg12...@gmail.com> wrote:
how to automatically store serenity-bdd reports in new folder with timestamp (e.g.: folder_name-timestamp) when I build maven project each time?

I want to achieve this: whenever I build the maven project, a new folder with timestamp (e.g.: folder_name-timestamp) should get created & the reports should get automatically stored in the newly created folder. In serenity.properties file, we can give "serenity.outputDirectory" property to configure the new path & folder to store reports. But how to append that folder name with timestamp automatically?

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
___________________________________________________
John Smart | Wakaleo Consulting  |  +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com  |  john....@wakaleo.com
___________________________________________________

We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery,  BDD, TDD and Clean Coding, and Advanced BDD Test Automation.

Need some help with Serenity BDD? Check out our Serenity BDD training and support packages here.
___________________________________________________

pg12...@gmail.com

unread,
Aug 27, 2017, 1:32:59 PM8/27/17
to Serenity BDD Users Group
Thank you John for quick reply and also, for suggesting an approach to the problem.

Can anyone please help me with this problem using Maven? Any kind of help would be appreciated.

John Smart

unread,
Aug 27, 2017, 1:45:54 PM8/27/17
to Serenity BDD Users Group, pg12...@gmail.com
Is there a reason you would need to do this on your local machine and not on a CI server?

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pg12...@gmail.com

unread,
Sep 16, 2017, 2:01:58 PM9/16/17
to Serenity BDD Users Group
I am able to achieve this because of your suggestion: I have added two maven steps in pom.xml. 
First step: Added the output directory in configuration: 
            <plugin>
                <groupId>net.serenity-bdd.maven.plugins</groupId>
                <artifactId>serenity-maven-plugin</artifactId>
                <version>${serenity.version}</version>
                <executions>
                    <execution>
                        <id>serenity-reports</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                        <configuration>
            <outputDirectory>A:/reports - ${current.time}</outputDirectory>
        </configuration>
                    </execution>
                </executions>
            </plugin>
 
Second Step: Added timestamp plugin
       <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>build-helper-maven-plugin</artifactId>
              <executions>
                  <execution>
                      <id>current-time</id>
                      <phase>validate</phase>
                      <goals>
                          <goal>timestamp-property</goal>
                      </goals>
                      <configuration>
                          <name>current.time</name>
                          <pattern>dd-MM-yyyy_HH-mm-ss</pattern>
                          <timeZone>IST</timeZone>
                      </configuration>
                  </execution>
              </executions>
      </plugin>

Thank you for the help John.

SeleniumWhat?

unread,
Sep 17, 2017, 10:26:17 AM9/17/17
to Serenity BDD Users Group
Cool beans!  Great tips.
Thanks
J.N
Reply all
Reply to author
Forward
0 new messages