New option extraGlue in @CucumberOptions - adds packages to search, keeping default package
See original GitHub issueSummary
It would be nice to have a new option in @CucumberOptions
to specify packages to search for glue in addition to the default search path.
Context & Motivation
The glue
option in @CucumberOptions
allows the glue search path to be specified, but it it is used, the default path (the current package) is not considered (unless it’s also included in the list passed to glue
).
It would be nice to have an option, say extraGlue
that allows packages to be added to the search path, in addition to the current package. It would be useful in adding common steps and especially hooks.
Possible Solution
I’ve looked at the code and I believe I can provide a pull request implementing this (including tests). I’m just checking before if someone would be against this feature.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to create dynamic glue in cucumber java based on the ...
Cucumber will search its classpath and find any step in the same package or a subpackage. Setting the location as suggested by MikeJRamsey56...
Read more >Announcing Cucumber - JVM version 4.0.0
I am happy to announce the release of Cucumber-JVM v4.0.0. This release features several new features, some quality of life improvements and ...
Read more >Cucumber Tests in Spring Boot with Dependency Injection
Both feature tests are configured by default to get all glue classes from within the same package so that parameter is omitted in...
Read more >Cucumber Options Glue - ProgramsBuzz
Glue Option helps Cucumber to locate the step definition file. We specify the package to load glue code (step definitions or hooks) in...
Read more >Authors - Citrus Framework
Citrus will look for all files located in the feature package with name pattern **/**.Steps.xml and load those definitions when Cucumber starts up....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ideally you put the runner one level above your glue and features. This means you dont have to configure them.
However this also means you can’t add extra glue from a library that is a sibling package of your Runner.
When no glue is provided the glue defaults to the package of the runner (the class annotated with
@CucumberOptions
).When glue is provided this default is ignored. Not so with extra glue.