I am using Allure for test reporting of a JUnit 5 project. I am using both Maven and Gradle in the same project (for teaching purposes).
Regarding Maven, this is my pom.xml. Everything works as expected:
I run my tests with mvn test and the JSON files generated by Allure are stored on the folder build\allure-results
I managed to run launch the HTML report using mvn allure:serve
Regarding Gragle, this is my build.gradle. I have two problems here:
I would like to save the JSON file on build/allure-results when running my tests (gradle test) but I don't make it. The JSON files end in the default path, allure-results (in the root of the project).
Anybody knows how can be done?
I would like to launch the HTML report with Gradle, but I don't know how.
Is there any command equivalent to mvn allure:serve in Gradle?
If you want to copy some file or directory content into build/allure-results folder via Gradle, you might want to check the following example: https://github.com/sskorol/allure2-testng-report/blob/c89c6ba5cb22d812c5deec012014cc9e31310173/build.gradle#L38
Regarding your second question, please check the official plugin's page: https://github.com/allure-framework/allure-gradle
Technically, you just need to download allure commandline (required only once) via:
gradlew allureReport
Then you can open report in browser via:
gradlew allureServe
Related
I have inherited a codebase whereby we have a maven project of component tests that use junit as the framework that runs the tests.
Everything runs OK, but the problem is that these tests must be compiled into a jar-with-dependencies so that they can be run on a standalone computer with very limited outwards connectivity (e.g does not have access to maven central).
I have managed to create a runnable jar with dependencies which I can run using junit.jar and the command line like so:
java -cp jar-with-dependencies.jar:junit.jar junit.jar org.junit.runner.JUnitCore com.testsuite.AllTests
This works but the problem is that I also need to output the junit results into XML, like maven's surefire plugin does.
My question is, can I run this jar-with-dependencies using maven such that it creates the junit xml reports?
I can successfully run the tests using exec-maven-plugin which essentially runs the previously stated command
I've created maven project with selenium and cucumber. I'm trying to use jira X-ray in a continuous integration setup. Basically I take exported feature files and want to execute them on a command line using bamboo.
I think my main problem is I'm not sure how to feed in feature files to a compiled maven project that has the step definitions.
I have features defined in src/test/resources/shouty
If I only want to run the location.feature using Maven, then I can use the command
mvn test -Dcucumber.options="src/test/resources/shouty/location.feature"
What you want to do is to specify the feature in the CI job using Maven as above.
Consider I have a maven java project that I wish to use the minimum version of Java possible. It has a number of dependencies. Is there a way I can see what the version of java used to compile the jar is for all of the resolved dependencies?
If you run mvn site on your project, one of the default reports (the 'Dependencies' report) generated will give you details about your dependencies.
After running mvn site find the target/site/dependencies.html file and open it in a browser. The section entitled "Dependency File Details" has a table in which one of the columns is the JDK revision used to compile a given dependency.
The maven-project-info-reports-plugin is what is responsible for generating this information. If you just want to generate that single html report from the command line you can do so with the following command
mvn project-info-reports:dependencies
The report will be located in the same place as with mvn site at target/site/dependencies.html
I am trying to run selenium scripts on Jenkins locally on my computer. I was using eclipse project and then i converted it to Maven by configure>convert to maven project. My Jenkins configuration is
Look at the configuration in the images. This is what I have done so far. I am a beginner to all this so don't know what I am missing. My console output on Jenkins is
Try this:
/user/Gauravgandhi/Documents/workspace/Applico/Website
for file system path and just pass pom.xml under Root Pom text box and define goals for the same.
I am hoping you configure JDK and Maven at jenkins level under configure jenkins link.
Please let me know if it works or not.
Gaurav,
Please make the setup using admin user in your machine or give full permission to your current user at every level.
I am successfully running Cucumber test on my java/maven eclipse project. But when I add my project do Jenkins I always get the following error "cucumber.runtime.CucumberException: No features found at []".
I read in this thread Setting cucumber-jvm options in Maven from the command line that:
...tests are running in separate JVM, so you need to specify that system property in the test plugin configuration (i.e. surefire or failsafe plugin config in your pom.xml)
But I am not quite sure how to do this. Can anyone help me?
PS: I am using "cucumber-java" and "cucumber-junit" dependencies.
If you're using surefire, the plugin documentation page http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html shows few options you can try to set system properties
For example you can try the systemPropertyVariables plugin settings
do you see the feature files in your target folder on your Jenkins slave ? maybe your *.feature files get excluded because of an incorrect config of your resources exclusion/inclusion in Maven ?