serenity-bdd / serenity-core

Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.
http://serenity-bdd.info
Other
718 stars 515 forks source link

Serenity 3.6.0, the API call informations aren't displayed in Serenity HTML report after running Cucumber scenarios with Serenity in parallel #3030

Closed HaiDoan1987 closed 1 year ago

HaiDoan1987 commented 1 year ago

I'm following the https://serenity-bdd.github.io/docs/guide/cucumber document to set up the cucumber test run in parallel. After the test run

  1. The Serenity HTML report is generated successfully
  2. The test results for each scenario are correct however when I try to view the API call information ( such as endpoint, payload, and response), It doesn't display on the Serenity Html reports
cucumber.execution.parallel.enabled=true
cucumber.execution.parallel.config.strategy=dynamic
cucumber.execution.parallel.config.fixed.parallelism=10
cucumber.plugin=io.cucumber.core.plugin.SerenityReporterParallel
@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("/features")
public class CucumberTestSuite {}
net.serenity-bdd serenity-core ${serenity.version} test
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-junit5</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-screenplay</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-screenplay-rest</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
org.junit.platform junit-platform-launcher 1.9.2 test
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit-platform-engine</artifactId>
        <version>7.11.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-suite</artifactId>
        <version>1.9.2</version>
        <scope>test</scope>
    </dependency>
    </dependency>
wakaleo commented 1 year ago

Fixed in 3.6.7

GianniGiglio commented 1 year ago

@cliviu Question since I was trying out the junit5 cucumber parallel execution. cucumber.execution.parallel.config.fixed.parallelism=10 is not taking into account because of this all scenario's are started in parallel. Even when I set the parallelism to 1 I see that for each scenario a worker thread is started simultaneously.

Could you confirm if you have the same issue?

GianniGiglio commented 1 year ago

@cliviu Question since I was trying out the junit5 cucumber parallel execution. cucumber.execution.parallel.config.fixed.parallelism=10 is not taking into account because of this all scenario's are started in parallel. Even when I set the parallelism to 1 I see that for each scenario a worker thread is started simultaneously.

Could you confirm if you have the same issue?

cliviu commented 1 year ago

hey @GianniGiglio , here are the docs . As long as cucumber.execution.parallel.enabled is set, the scenarios are executed in parallel.

GianniGiglio commented 1 year ago

hey @GianniGiglio , here are the docs . As long as cucumber.execution.parallel.enabled is set, the scenarios are executed in parallel.

Thanks I know but image you have 20 scenario's and you've set cucumber.execution.parallel.config.fixed.parallelism=5 I see that all 20 scenario's are executed at the same time in parallel instead of just 5

cliviu commented 1 year ago

This may be a good question for the Cucumber team I guess. We are just dealing with whatever threads are coming :-).

GianniGiglio commented 1 year ago

This may be a good question for the Cucumber team I guess. We are just dealing with whatever threads are coming :-).

Thanks i'll open a ticket for the cucumber team. I as just trying to confirm if you experienced the same issue. you can easlily see this when you use the timeline plugin

cucumber.plugin=io.cucumber.core.plugin.SerenityReporterParallel, pretty, json:target/cucumber.json, timeline:build/timeline/

The report clearly shows that all scenario's are executed at the same time instead of the number you configure. Makes it pretty unusable in this state

wakaleo commented 1 year ago

As @cliviu said, this is more a question for the Cucumber folk (Serenity doesn't have any control over how you configure the JUnit 5/Cucumber parallel options), but is it a fixed number of threads in total, or a fixed number of threads per core?

GianniGiglio commented 1 year ago

@wakaleo fixed number of threads based om my junit 5 experiance and parallelization. Agreed that this is a cucumber-jvm question or even something to ask the Junit team.

GianniGiglio commented 1 year ago

@wakaleo FYI this is a know bug you need to set the .max-pool-size property. If not, you run into a JUnit bug where more threads will start when your test waits for Web Driver to start.

cliviu commented 1 year ago

@GianniGiglio Cool, thanks for the update