Search code examples
javaintellij-ideacucumber

How to glue multiple steps directories to a cucumber test in Intellij?


I have a Cucumber scenario whose steps are defined in multiple Step files, as opposed to only having only one. If I decide to run the test using Intellij I go to run/debug configurations menu and the form provides a field named glue which enables me to specify the steps package.

So far I was able to run the scenarios that have all steps defined in the same Steps file, but I was unable to figure out how to do it for the scenarios that require multiple steps files located in different packages. I've tried a csv approach but without success. Does anyone know what I am missing? Thank you for your help.


Solution

  • M.P. Korstanje's answer provides very useful tips but not for this specific case. What worked for me was:

    1. Specify the parent package as opposed to several distinct sub-packages (e.g. use only com.example instead of both com.example.steps1, com.example.steps2) in the Glue field
    2. Select the correct module in the Use classpath of module field.

    enter image description here