question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Adding glueClass to CucumberOptions

See original GitHub issue

Summary

I was wondering if the project would be open to add something like this:

  /**
   * @return class(es) to look for glue code (step definitions and hooks).
   *         Optional.
   */
  Class<?>[] glueClass() default {};

To the CucumberOptions (which now seem to be split by test framework).

Context & Motivation

The use of actual classes allows the option for easier code refactoring (renaming the class containing the glue code will automatically also rename this since it is not a string).

We as well need a more fine granular configuration in our project on which classes should be loaded (we do have classes in the same package that should not be loaded together).

We currently have a custom runner based on an older cucumber version that implements this behavior for us.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:23 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
mpkorstanjecommented, Mar 23, 2020

We don’t support classes yet but we would if were were to implement support for classes (don’t know to phrase this in English 😄 )

The important bit is that loadGlue is getting too many arguments. I’d rather see something like:

loadGlue(Glue glue, GlueSelectors selectors)

Where you’d do selectors.getSelectorsFor(PackageSelectors.class) to get the package selectors.

2reactions
mpkorstanjecommented, Oct 9, 2019

Please feel free to do so!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cucumber options annotation - Stack Overflow
I have successfully used something like: @RunWith(Cucumber.class) @Cucumber.Options( //this code will only look into "features/" folder for ...
Read more >
Cucumber Tests in Spring Boot with Dependency Injection
We want to use Dependency Injection in our tests with Spring, so we'll add the cucumber-spring dependency on top of the common cucumber-java ......
Read more >
Cucumber Reference - Cucumber Documentation
Cucumber can be used to implement automated tests based on scenarios described in your Gherkin feature files. Step Arguments. In the example given...
Read more >
Index (Cucumber-JVM: Core 6.8.1 API) - Javadoc.io
Add a glue class to the test context. addDataTableType(DataTableTypeDefinition) - Method in interface io.cucumber.core.backend.
Read more >
Selenium series: Implementing Cucumber - Octopus Deploy
To start we need to add two dependencies: cucumber-java and ... The cucumber-junit library allows us to execute Gherkin features and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found