Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

execute multiple cucumber feature files

When I submit a single feature file it works perfectly. I want to pass features folder path which has multiple feature files into runner script. Can anyone help to execute multiple feature files?

All feature files have same steps but data is different and file name is different.

@RunWith(Cucumber.class)

@CucumberOptions(format = {"pretty"}, features =
"C:\\TESTER\\Execution\\uidata\\featurefiles\\",
        glue={"com.test.auto.stepdefs"},dryRun=false) 

public class CucumberTest { 

}

I appreciate you help.

like image 459
sri Avatar asked Aug 16 '16 20:08

sri


People also ask

Can we run multiple feature files in Cucumber?

Cucumber can be executed in parallel using TestNG and Maven test execution plugins by setting the dataprovider parallel option to true. In TestNG the scenarios and rows in a scenario outline are executed in multiple threads. One can use either Maven Surefire or Failsafe plugin for executing the runners.

How do I run multiple features parallel in Cucumber?

Cucumber can be executed in parallel using JUnit and Maven test execution plugins. In JUnit, the feature files are run in parallel rather than scenarios, which means all the scenarios in a feature file will be executed by the same thread. You can use either Maven Surefire or Failsafe plugin to execute the runner.

How do I run a whole feature in Cucumber?

Run Cucumber tests with JUnitIn the Project tool window, right-click the package with step definitions and select New | Java Class. Name the new class (for example, RunCucumberTest ) and press Enter . In @CucumberOptions , specify the . feature file and the package with step definitions in your project (Glue).


1 Answers

The features path must be relative to your project classpath. For example it can look like this:

@CucumberOptions(features = {"classpath:features_folder1", "classpath:features_folder2"}, ...)

or

@CucumberOptions(features="src/test/resources")
like image 112
Eugene S Avatar answered Oct 16 '22 15:10

Eugene S