Cucumber reports are overwritten when a new function file is executed

I am writing a test package and ran into a problem. I use cucumber and defined several function files. When I run the test package, the progress (html report and json format) of one function file is overwritten the next time the next file is run.

I have several test classes that define these function files. I am trying to find a way in which I can get one html report for all function runs to give a consolidated view.

Examples of test files for reference:

@CucumberOptions(plugin = { "pretty", "html:target/report/html",
"json:target/report/json/result.json" })
public class BaseFeature {

}

@RunWith(Cucumber.class)
@CucumberOptions(features = "classpath:test/feature/rest/query.feature"
, monochrome = true
, glue={"a.b.c.rest"})
public class RunTest1 extends BaseFeature {

}

@RunWith(Cucumber.class)
@CucumberOptions(features="classpath:test/feature/soap/book.feature"
, monochrome = true
, glue="a.b.c.soap")
public class RunTest2 extends BaseFeature {

}

Know what you can do to have a summary report.

+4
2

, , , . maven, .

<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>${maven-cucumber-reporting.version}</version>

: 3.3.0

, json.

:

<plugins> ...

  <plugin>
    <groupId>net.masterthought</groupId>
    <artifactId>maven-cucumber-reporting</artifactId>
    <version>${maven-cucumber-reporting.version}</version>
    <executions>
      <execution>
        <id>execution</id>
        <phase>verify</phase>
        <goals>
          <goal>generate</goal>
        </goals>
        <configuration>
          <projectName>test-report</projectName>
          <outputDirectory>${project.build.directory}/bdd/report</outputDirectory>
          <cucumberOutput>${project.build.directory}/report/json</cucumberOutput>
          <parallelTesting>false</parallelTesting>
        </configuration>
      </execution>
    </executions>
  </plugin>

</plugins>

, :

cucumberOutput: Path to where all the json reports are kept after the cucumber run outputDirectory: Path to where the html report will be generated

.

+3

, 1, 1 . RunWith , 1 , 1 .

+1

Source: https://habr.com/ru/post/1665500/


All Articles