Create BDD test cases in Katalon Studio
This section shows you how to create BDD test cases in Katalon Studio.
Include a feature file in test cases
To include a Cucumber feature file in Katalon Studio test case, you can use Cucumber keywords in your test case. Katalon Studio supports Cucumber keywords along with the original built-in keywords. You do not have to import Cucumber libraries into Katalon Studio.
- You can only use custom keywords in your BDD tests when the step definition of the feature file belongs to the default package.
|Use cases||Cucumber keywords|
|Execute a single Feature File (with or without tags)|
|Execute multiple Feature Files (with or without tags)|
|Execute using Cucumber Runner|
After you execute your BDD tests, you can view BDD report files generated from Katalon Studio or upload and view reports on Katalon TestOps. See: View BDD reports.
Create BDD test case with Cucumber Hooks
- Set up Cucumber hooks in Katalon Studio. See: Set up Cucumber hooks.
- Create a new test case.You can refer to this document: Create a new test case in Katalon Studio.
- In the Manual view of the new test case, click on the Add dropdown button and select Cucumber Keywords.
- Select the Run Feature File keyword.
- Right-click on the Feature file and select Copy ID to get the relative path.
- Double-click on the Input cell of the Run Feature File keyword. In the displayed Input dialog, paste the copied relative path from step 3 as the input value.
- Run the test and verify the message of the Cucumber hooks in the Console log: