class CucumberBuiltinKeywords extends BuiltinKeywords
Constructor and description |
---|
CucumberBuiltinKeywords
() |
Type Params | Return Type | Name and description |
---|---|---|
|
static CucumberRunnerResult |
runFeatureFile(String relativeFilePath, FailureHandling flowControl) Runs the given Feature file with featureId by invoking
cucumber.api.cli.Main#run(String[], ClassLoader).
|
|
static CucumberRunnerResult |
runFeatureFile(String relativeFilePath) Runs the given Feature file with featureId by invoking
cucumber.api.cli.Main#run(String[], ClassLoader).
|
|
static CucumberRunnerResult |
runFeatureFileWithTags(String relativeFilePath, String[] tags, FailureHandling flowControl) Runs the given Feature file with featureId by invoking
cucumber.api.cli.Main#run(String[], ClassLoader).
|
|
static CucumberRunnerResult |
runFeatureFileWithTags(String relativeFilePath, String[] tags) Runs the given Feature file with featureId by invoking
cucumber.api.cli.Main#run(String[], ClassLoader).
|
|
static CucumberRunnerResult |
runFeatureFolder(String folderRelativePath, FailureHandling flowControl) Runs the given Feature folder and its nested sub-folder with folderRelativePath
by invoking cucumber.api.cli.Main#run(String[], ClassLoader).
|
|
static CucumberRunnerResult |
runFeatureFolder(String folderRelativePath) Runs the given Feature folder and its nested sub-folder with folderRelativePath
by invoking cucumber.api.cli.Main#run(String[], ClassLoader).
|
|
static CucumberRunnerResult |
runFeatureFolderWithTags(String folderRelativePath, String[] tags, FailureHandling flowControl) Runs the given Feature folder and its nested sub-folder with folderRelativePath
by invoking cucumber.api.cli.Main#run(String[], ClassLoader).
|
|
static CucumberRunnerResult |
runFeatureFolderWithTags(String folderRelativePath, String[] tags) Runs the given Feature folder and its nested sub-folder with folderRelativePath
by invoking cucumber.api.cli.Main#run(String[], ClassLoader)
The generated reports will be extracted in the current report folder with the following path: <report_folder>/cucumber_report/<current_time_stamp> |
|
static CucumberRunnerResult |
runWithCucumberRunner(Class cucumberRunnerClass, FailureHandling flowControl) Runs the given cucumberRunnerClass that is annotated with Cucumber runner by invoke JUnit
runner. |
|
static CucumberRunnerResult |
runWithCucumberRunner(Class cucumberRunnerClass) Runs the given cucumberRunnerClass that is annotated with Cucumber runner by invoke JUnit
runner. |
Methods inherited from class | Name |
---|---|
class BuiltinKeywords |
callTestCase, callTestCase, comment, concatenate, concatenate, delay, delay, verifyCheckpoint, verifyCheckpoint, verifyEqual, verifyEqual, verifyGreaterThan, verifyGreaterThan, verifyGreaterThanOrEqual, verifyGreaterThanOrEqual, verifyLessThan, verifyLessThan, verifyLessThanOrEqual, verifyLessThanOrEqual, verifyMatch, verifyMatch, verifyNotEqual, verifyNotEqual, verifyNotMatch, verifyNotMatch |
Runs the given Feature file with featureId
by invoking
cucumber.api.cli.Main#run(String[], ClassLoader).
If your step definitions are in packages, you can set glue path to help system can detect your step definitions path easier.
<report_folder>/cucumber_report/<current_time_stamp>
Examples:
- Example #1: Run a single feature file
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.runFeatureFile('Include/features/New Feature File.feature', FailureHandling.STOP_ON_FAILURE)
- Example #2: Run a single feature file and the step definitions is in pre-defined packages
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.GLUE = ['mypackage1', 'mypackage2']
CucumberKW.runFeatureFile('Include/features/New Feature File.feature', FailureHandling.STOP_ON_FAILURE)
- Parameters:
relativeFilePath
- relativeFilePath of Feature fileflowControl
- an instance FailureHandling that controls the running flow
- Returns:
- an instance of CucumberRunnerResult that includes status of keyword and report folder location.
- Since:
- 5.7
- See Also:
- CucumberRunnerResult
Runs the given Feature file with featureId
by invoking
cucumber.api.cli.Main#run(String[], ClassLoader).
If your step definitions are in packages, you can set glue path to help system can detect your step definitions
path easier.
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW CucumberKW.runFeatureFile('Include/features/New Feature File.feature')
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW CucumberKW.GLUE = ['mypackage1', 'mypackage2'] CucumberKW.runFeatureFile('Include/features/New Feature File.feature')
relativeFilePath
- relativeFilePath of Feature file Runs the given Feature file with featureId
by invoking
cucumber.api.cli.Main#run(String[], ClassLoader).
If your step definitions are in packages, you can set glue path to help system can detect your step definitions path easier.
<report_folder>/cucumber_report/<current_time_stamp>
Examples:
- Example #1: Run a single feature file with selected tags
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.runFeatureFile('Include/features/New Feature File.feature', ['@foo', 'not @bar'] as [], FailureHandling.STOP_ON_FAILURE)
- Example #2: Run a single feature file with selected tags and the step definitions is in pre-defined packages
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.GLUE = ['mypackage1', 'mypackage2']
CucumberKW.runFeatureFile('Include/features/New Feature File.feature', ['@foo', 'not @bar'] as [], FailureHandling.STOP_ON_FAILURE)
@bar']: Select all foo tags but not bar tags - Parameters:
relativeFilePath
- relativeFilePath of the feature filetags
- what tags in the features should be executed. Eg: ['@foo', 'notflowControl
- an instance FailureHandling that controls the running flow
- Returns:
- an instance of CucumberRunnerResult that includes status of keyword and report folder location.
- Since:
- 7.0.0
- See Also:
- CucumberRunnerResult
Runs the given Feature file with featureId
by invoking
cucumber.api.cli.Main#run(String[], ClassLoader).
If your step definitions are in packages, you can set glue path to help system can detect your step definitions
path easier.
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW import com.kms.katalon.core.model.FailureHandling CucumberKW.runFeatureFile('Include/features/New Feature File.feature', ["@foo", "not @bar"] as [], FailureHandling.STOP_ON_FAILURE)
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW import com.kms.katalon.core.model.FailureHandling CucumberKW.GLUE = ['mypackage1', 'mypackage2'] CucumberKW.runFeatureFile('Include/features/New Feature File.feature', ["@foo", "not @bar"] as [], FailureHandling.STOP_ON_FAILURE)
relativeFilePath
- relativeFilePath of Feature filetags
- what tags in the features should be executed. Eg: ['@foo', 'not Runs the given Feature folder and its nested sub-folder with folderRelativePath
by invoking cucumber.api.cli.Main#run(String[], ClassLoader).
If your step definitions are in packages, you can set glue path to help system can detect your step definitions path easier.
<report_folder>/cucumber_report/<current_time_stamp>
Examples:
- Example #1: Run all features file in the specified folder
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.runFeatureFolder('Include/features', FailureHandling.STOP_ON_FAILURE)
- Example #2: Run all features file in the specified folder and the step definitions is in pre-defined packages
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.GLUE = ['mypackage1', 'mypackage2']
CucumberKW.runFeatureFolder('Include/features', FailureHandling.STOP_ON_FAILURE)
- Parameters:
folderRelativePath
- folder relative path that starts from the current project locationflowControl
- an instance FailureHandling that controls the running flow
- Returns:
- an instance of CucumberRunnerResult that includes status of keyword and report folder location.
- Since:
- 5.7
Runs the given Feature folder and its nested sub-folder with folderRelativePath
by invoking cucumber.api.cli.Main#run(String[], ClassLoader).
If your step definitions are in packages, you can set glue path to help system can detect your step definitions path easier.
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW CucumberKW.runFeatureFolder('Include/features')
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW CucumberKW.GLUE = ['mypackage1', 'mypackage2'] CucumberKW.runFeatureFolder('Include/features')
folderRelativePath
- folder relative path that starts from current project location Runs the given Feature folder and its nested sub-folder with folderRelativePath
by invoking cucumber.api.cli.Main#run(String[], ClassLoader).
<report_folder>/cucumber_report/<current_time_stamp>
- Example #1: Run a single feature file with selected tags
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.runFeatureFolderWithTags('Include/features/New Feature File.feature', ["@foo", "not @bar"] as [], FailureHandling.STOP_ON_FAILURE)
- Example #2: Run a single feature file with selected tags and the step definitions is in pre-defined packages
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.GLUE = ['mypackage1', 'mypackage2']
CucumberKW.runFeatureFolderWithTags('Include/features/New Feature File.feature', ["@foo", "not @bar"] as [], FailureHandling.STOP_ON_FAILURE)
@bar']: Select all foo tags but not bar tags - Parameters:
folderRelativePath
- folder relative path that starts from the current project locationtags
- what tags in the features should be executed. Eg: ['@foo', 'notflowControl
- an instance FailureHandling that controls the running flow
- Returns:
- an instance of CucumberRunnerResult that includes status of keyword and report folder location.
- Since:
- 7.0.0
Runs the given Feature folder and its nested sub-folder with folderRelativePath
by invoking cucumber.api.cli.Main#run(String[], ClassLoader)
<report_folder>/cucumber_report/<current_time_stamp>
- Example #1: Run a single feature file with selected tags
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.runFeatureFolderWithTags('Include/features/New Feature File.feature', ["@foo", "not @bar"] as [])
- Example #2: Run a single feature file with selected tags and the step definitions is in pre-defined packages
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.model.FailureHandling
CucumberKW.GLUE = ['mypackage1', 'mypackage2']
CucumberKW.runFeatureFolderWithTags('Include/features/New Feature File.feature', ["@foo", "not @bar"] as [])
@bar']: Select all foo tags but not bar tags - Parameters:
folderRelativePath
- folder relative path that starts from current project locationtags
- what tags in the features should be executed. Eg: ['@foo', 'not
- Returns:
- an instance of CucumberRunnerResult that includes status of keyword and report folder location.
- Since:
- 7.0.0
Runs the given cucumberRunnerClass
that is annotated with Cucumber runner by invoke JUnit
runner.
cucumberRunnerClass
- a class that is annotated with Cucumber runner.
Example of cucumberRunnerClass
:
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 {}
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 {}
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 { }
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 { }
flowControl
- an instance FailureHandling that controls the running flow Runs the given cucumberRunnerClass
that is annotated with Cucumber runner by invoke JUnit
runner.
cucumberRunnerClass
- a class that is annotated with Cucumber runner.
Example of cucumberRunnerClass
:
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 {}
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 {}
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 { }
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 { }