简体   繁体   中英

Serenity Bdd Report not getting generated after testcase is success- (In Eclipse and Jenkins both)

I have created a BDD test case in Eclipse and the maven build for the test case is a success. I have also created this same project as a maven job in Jenkins and the build is success for it as well. Generally from what I have studied, the report should be located in Target>Site>Serenity but for me the report is not getting generated in that location.

  1. In Eclipse, there is no error in console log and it shows the following:
    Generating reports view to 'C:\Dev..\target\jbehave' using formats '[stats,console,html,xml,serenityreporter,junitscenarioreporter]' and view properties'{decorateNonHtml=true}'

(I checked and saw that a file named index.html is getting formed in target>jbehave>view folder but that file doesn't have any report contents.)

  1. In Jenkins the console log shows the following: Error: Specified HTML directory 'C:/Jenkins/workspace/Devops/.../target/site/serenity does not exit. Build step'Publish HTML reports' changed build result to FAILURE. Finished:FAILURE

I had given the report path in Jenkins in -Post Build Actions- as target>site>serenity initially but seeing that the report instead might be in jbehave folder I changed the path,but still got the following error:

Error: Specified HTML directory 'C:/Jenkins/workspace/Devops/.../target/jbehave/view does not exit. Build step'Publish HTML reports' changed build result to FAILURE. Finished:FAILURE

Things checked : 1)Checked Jenkins- "the HTML Publisher Plugin" version 1.23 is present. So report should be generated.

For Eclipse:

  1. Following properties used in pom.xml:

serenity.version-1.8.21, serenity.maven.version-1.8.21, serenity.jbehave.version-1.35, a-maven-plugin.version=4.1.1

  1. Giving both maven-surefire-plugin and maven-failsafe-plugin(version2.18) in pom.xml

  2. Giving "clean verify serenity:aggregate" in goals in run configuration.

  3. In serenity.properties file added the following 2 lines in an attempt to generate report in an alternate location but still no reports or new folder with report generated.

`serenity.test.root = "net.bdd project"

serenity.outputDirectory = target/site/reports`

What could be the reason for report not getting generating in proper location? Is it the properties versions in pom.xml? or something else to be added in serenity.properties? My understanding is that the default location for test report is to be in target>site>serenity. Is there a way we can manually configure this? If the report is generated in eclipse, will it get generated in jenkins too? (using the same project through git in jenkins)

Please provide some inputs as this is my 1st test case and 1st time working on bdd. Really appreciate it. Thanks!

I resolved the above issue and I managed to generate the report in Jenkins. I did the following: 1)Changed the versions in properties in pom.xml file to the following:

serenity.version-1.2.4, serenity.maven.version-1.2.4, serenity.jbehave.version-1.1.0, a-maven-plugin.version=4.3.1

2)In Jenkins post build config, I changed the following:

<alwayslinktolastbuild> true </alwayslinktolastbuild> <keepAll>true</KeepAll> <reportDir>${WORKSPACE}/target/site/serenity</reportDir>

Hope this helps: Thanks! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM