1

im trying to setup a cucumber with spring project to use autowiring and spring config options (application.yml). Now that i created a runner class to pass parameters from outside executing runs on following exception:

Error Message

Weird is, i have a class exactly with the proposed annotations, so i guess it's not found and something on the project structure is off, but i don't get what exactly. Here is my project structure:

 src.main.java.package.config.SpringConfig.java
 src.main.java.package.steps.StepsSpringConfig.java
 src.test.java.package.runner.CucumberRunner.java

SpringConfig.java

@ComponentScan("package")
@EnableConfigurationProperties{PropertyClasses}

StepsSpringConfig.java

@SpringBootTest(classes = SpringConfig.class)
@CucumberContextConfiguration

All Step classes extend from this class

CucumberRunner.java

@RunWith(Cucumber.class)
@CucumberOptions(steps = path/to/features, glue = {src.package.steps, src.package.config})

In my JUnit RunConfig I use this runner class

When i run i get the error on the screenshot above. What am i missing? Im using the latest version of IntelliJ (2021.2.2) Im using Spring 2.3.12 and cucumber-junit 6.8.0

1 Answer 1

1

Ok im dumb, the solution is found here: Cucumber options annotation

i specified the glue path like "src.main.java.package.steps" but it needs to be just "package.steps" and it works fine

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.