5

I'm currently working on a Cucumber project using Katalon Studio, and I'm not sure if...

I need to directly write the test items on Step Definition file OR Should I call the test cases in Step Definition and then create a separate Test Case that would call the Feature file using the Step Definition?

I've searched about this and there aren't so many guides on how to PROPERLY do it, only how to properly write Gherkin format. Basically what I'm after is to know the best practices in the industry using BDD Katalon Studio Projects

4

I personally divide the logic into three levels:

  1. feature file (Cucumber),
  2. step definition (Cucumber + Java),
  3. page objects (Selenium and Java).

Cucumber separates business logic from the programming logic (1. and 2.) and the page object pattern separates test methods from the pages locators.

4

Katalon has an example project on github: https://github.com/katalon-studio-samples/katalon-bdd-cucumber-tests

Although I find the directory structure hard to navigate the feature example does follow a pattern like:

Look similar to my default strategy when I use Cucumber, Steps and Page Objects.

The best practise is not to use page elements/locators or implementation specifics in the steps. I prefer steps to be readable/understandble by a manual tester (or business person) with a one hour crash course in basic programming.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.