Skip to content
Discussion options

You must be logged in to vote

There is an implicit assumption in Maven/Gradle, JUnit and Cucumber that tests are independent. If you stay within that tool chain, what you're looking to do isn't really possible.

However, if you don't mind launching your tests from a main method instead, you could use JUnits Launcher API.

https://docs.junit.org/current/user-guide/#launcher-api

Prior to execution, the launcher API can provide a test plan. You can inspect that test plan and work out the requirements for your setup. Once you've completed the setup you can ask JUnit to execute the test plan. Cucumber provides tags and file names to JUnit so you can make decisions based of those.

You'd run all this from a main method which y…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mpkorstanje
Comment options

Comment options

You must be logged in to vote
1 reply
@mpkorstanje
Comment options

Answer selected by wazzeps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants