-1

I have 3 feature files each features contains of 3 tests so in total 9 tests but only 3 tests are executing and its picking up on;y 1st feature file.I have given global tag @smoke in all feature files Please find the pom file below. io.github.bonigarcia webdrivermanager 4.0.0 org.seleniumhq.selenium selenium-java 3.141.59
junit junit 4.13 test org.hamcrest hamcrest-all 1.3 test info.cukes cucumber-java 1.2.5 info.cukes cucumber-junit 1.2.5 info.cukes cucumber-jvm-deps 1.0.5 provided net.masterthought cucumber-reporting 5.0.2

<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>gherkin</artifactId>
    <version>2.12.2</version>
    <scope>provided</scope>
</dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M4</version>
          <configuration>
          <parallel>methods</parallel>
       <useUnlimitedThreads>true</useUnlimitedThreads>
        </configuration>
        </plugin>   
      </plugins>
    </pluginManagement>
  </build>
  • How many test methods you have in one test class? If it is just one, it would not be like you want. And so make parallel classes - not methods. – tibor17 May 24 '20 at 18:47
  • You can't excecute in parallel with that version of Cucumber. Try the most recent one (v5). – M.P. Korstanje May 25 '20 at 23:12

1 Answers1

0

There are several options to incorporate parallel execution feature in a Cucumber project, like:

  1. JUnit
  2. TestNG
  3. CLI

but in the execution there are some differences. one of the differences is how they read the feature files and set separate threads to run the scenarios. JUnit (which you have used) uses one thread per feature file not per scenario or other parts in the files.

if you want all scenarios to run at once, write them in different feature files or use TestNG instead of JUnit.

more info on: https://cucumber.io/docs/guides/parallel-execution/

Majid Roustaei
  • 1,556
  • 1
  • 20
  • 39