0

I am following BDD framework. I have 21 feature files and all the feature files tags are passed in Testrunner. Now suppose one of the feature files failed due to some reason my automation stops which I don't want so I have wrapped all my code in catch clause. Now the catch clause does get call but I am not able to figure out how to programmatically start the next test case. Here are few of the code samples which I tried but I am not able to glue stepdefinition file with feature file

Soln One:

Main.run(new String[]{"--glue",
                    "src/test/java/stepDefinitions",
                    "--tags", "@testfiveappformregression", "src/test/java/features"});

Soln Two:

Main.main(new String[]{
                        "-g",
                        "src/test/java/stepDefinitions", 
                        "src/test/java/features/TestFiveAppFormRegression.feature"}
                    );

Soln Three:

 Main.main(new String[]{"-g", "stepDefinitions","-t", "@Regression","-p", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:", "src/test/java/features/"});

If I run the test cases one by one via test runner then it works but I want to execute it in batch

BraveEvidence
  • 53
  • 11
  • 45
  • 119

1 Answers1

0

I got it working

String[] argv = {
                    "--glue", "stepDefinitions",
                    "--tags", "@testfivecomprehensiveci",
                    "src/test/java/features"
                };

         Main.run(argv, Thread.currentThread().getContextClassLoader());
BraveEvidence
  • 53
  • 11
  • 45
  • 119