Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Create a New Test Case and use Cucumber built-in keyword "runFeatureFile" as demonstrated example below.
  • Execute the Test Case normal

    Code Block
    themeEclipse
    CucumberKW.runFeatureFile('Include/features/New Feature File.feature')




    2. Execute multiple Feature Files 
    You can execute multipleFeatureFiles as long as they are within the same 'features' folder using 'runFeatureFolder' built-in keyword. 

    Code Block
    themeEclipse
    CucumberKW.runFeatureFolder('Include/features/New Feature File.feature')


    3. Execute using Cucumber Runner:

    Using 'runWithCucumberRunner' keyword, you can execute a Feature File with a set of options.  Example you've created a Step Definitions called MyCucumberRunner within scripts folder

    Code Block
    languagegroovy
    themeEclipse
    CucumberKW.runWithCucumberRunner(MyCucumberRunner.class)
    


    • Example #1: Run all Feature files in Include/features Folder
       import org.junit.runner.RunWith;
       import cucumber.api.CucumberOptions;
       import cucumber.api.junit.Cucumber;
       
       @RunWith(Cucumber.class)
       @CucumberOptions(features = "Include/features", glue = "")
       public class MyCucumberRunner {}
       
    • Example #2: Run all Feature files in a specified file/folder
       import org.junit.runner.RunWith;
       import cucumber.api.CucumberOptions;
       import cucumber.api.junit.Cucumber;
       
       @RunWith(Cucumber.class)
       @CucumberOptions(features = "Your_Folder_Or_File_Path", glue = "")
       public class MyCucumberRunner {}
       
    • Example #3: Run all Feature files in a specified file/folder, generate JUnit Cucumber report with XML pretty format, and copy to a specified folder
       import org.junit.runner.RunWith;
       import cucumber.api.CucumberOptions;
       import cucumber.api.junit.Cucumber;
       @RunWith(Cucumber.class)
       @CucumberOptions(features="Your_Folder_Path", glue="", plugin = ["pretty",
                            "junit:Folder_Name/cucumber.xml"])
       public class MyCucumberRunner {
       }
       
    • Example #4: Run all Feature files in a specified file/folder, generate multi Cucumber reports with XML, JSON, HTML pretty format, and copy to a specified folder
       import org.junit.runner.RunWith;
       import cucumber.api.CucumberOptions;
       import cucumber.api.junit.Cucumber;
       @RunWith(Cucumber.class)
       @CucumberOptions(features="Your_Folder_Path", glue="", plugin = ["pretty",
                            "junit:Folder_Name/cucumber.xml",
                            "html:Folder_Name",
                            "json:Folder_Name/cucumber.json"])
       public class MyCucumberRunner {
       }

       

  •  

Cucumber Reports

There is NO custom report for executing Feature File. Katalon Studio uses only generated Cucumber reports for Test Suite/Test Suite Collection execution level, in which the test cases contain the Cucumber Features file. The generated Cucumber report of Test Suite/Test Suite Collection will be located in the same folder of Katalon Studio report's folder:

...