1

I have two cucumber feature files. 1) Feature 1 2) Feature 2

I have one CucumberWithSerenity runner class.

When I run both feature files together, using the same runner class the report generation is failing with the below error.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':runTests'.

    Multiple build operations failed. Could not write XML test results

It's a gradle based project, and the task fails.

My observations:

As the serenity is saving the results/screenshots for both the feature files in the same below directory : /target/site/ it's failing to generate two seperate reports at run time. Please can I get some help on how to generate two seperate reports for both feature files using the same runner class.

  • I'm not sure that's Serenity-related (Serenity doesn't produce XML reports, only JSON ones). What versions are you using? – John Smart Nov 12 '19 at 23:14
  • No John, it's not that the issue, as when I run two features/scenarios the results for both the scenarios are getting stored in /target/site/serenity folder, and the report generation is failing, maybe because I am using same serenity-junit runner class to run both of my tests and Junit is trying to generate an XML before generating the actual HTML reports. What I want to achieve is, when I run two gradle tasks together for two different features/scenarios using -tags, I want seperate HTML reports to be generated. Please can you help me how can I achieve this? – Mr. Ravi Arkasali Nov 12 '19 at 23:39
  • I use the below: dependencies { 'serenity-core', version: '2.0.48' 'serenity-junit', version: '2.0.48' 'junit', version: '4.12' 'serenity-cucumber', version: '1.9.45' } – Mr. Ravi Arkasali Nov 12 '19 at 23:45
  • Have marked *** for the names, this is my runner class import cucumber.api.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; import org.junit.runner.RunWith; @RunWith(CucumberWithSerenity.class) @CucumberOptions(features = {"src/test/resources/features/***/","src/test/resources/features/***/"}, /*plugin = { "rerun:rerun.txt"},glue={"com/***/***/features/steps/","com/***/**/features/steps/"})*/ plugin = {},glue={"com/***/***/features/steps/","com/***/***/features/steps/"}) public class AcceptanceTests { } – Mr. Ravi Arkasali Nov 12 '19 at 23:47
  • Here are my commands to run the test, Terminal 1 : gradle clean runTests -Denv=“test” -Dcucumber.options="--tags @test123” --info Terminal 2 : gradle clean runTests -Denv=“test” -Dcucumber.options="--tags @test345” --info When executed together, want the tests to generate two seperate HTML reports. It will be of great help if you could help me achieve this? – Mr. Ravi Arkasali Nov 12 '19 at 23:52

0 Answers0