Comments (8)
Do you have a simple reproducer I can look at?
from quarkus-cucumber.
While i was creating a reproducer project, i found out the issue.
The issue occurs when I run a single scenario through intellj plugin; Intellj creates a cucumber run configuration. but then dependencies inside steps are null.
But when i run from the Runner class extending CucumberQuarkusTest, tests pass without issue and dependency injection works without problem. Intellj creates a gradle run configuration at this case.
please find attached project.
https://github.com/ahmedabbas11/quarkus-cucumber-dependency
While i can runs tests from gradle now, but running all the tests each time is not practical at the long run , whe steps grow in size and it would take time to run them all, then it is necessary to be able to run single scenario.
from quarkus-cucumber.
ok that makes sense to me because when running the test via Cucumber IntelliJ the @QuarkusTest
annotation is not taken into account. This is simply because Cucumber is running the test and not Quarkus (via JUnit5). Not sure if the test is even run with JUnit5 when running via IntelliJ Cucumber plugin. When running the test with CucumberQuarkusTest the @QuarkusTest
annotation prepares everything including @Inject
support.
So at the moment I do not see a simple solution for that
from quarkus-cucumber.
Ah! This PR might solve this issue: #2
from quarkus-cucumber.
Is that PR all that is required?
from quarkus-cucumber.
Following is needed:
- The PR #2
- Adding a main method to the test class:
public static void main(String[] args) {
runMain(CucumberOptionsTest.class, args);
}
from quarkus-cucumber.
The solution for this is restoring the original class loader within the test.
So once the context has been created, obtain the classloader and store it:
var originalClassLoader = Thread.currentThread().getContextClassLoader();
And when executing the test restore it in the test thread:
context.runTestCase(r -> {
if (originalClassLoader != null) {
Thread.currentThread().setContextClassLoader(originalClassLoader);
}
r.runPickle(p);
});
from quarkus-cucumber.
@ahmedabbas11 , I want to know how you are running your cucumber tests, is it integrated with your quarkus application or you have dedicated cucumber project, using its dependency in your qaurkus application and invoking cucumber tests ?
from quarkus-cucumber.
Related Issues (20)
- Add support for uri linking per feature and scenario HOT 3
- NoClassDefFoundError with Version 1.0.0 HOT 2
- Failure if used with quarkus-datadog-opentracing HOT 1
- Execution of multiple tests not possible due to terminated state
- Only scenarios should be considered as Tests (starting/ending cucumber and beforeFeature methods should not) HOT 1
- Add possibility to extend method CucumberQuarkusTest.getTests HOT 2
- Quarkus Continuous Testing re-runs all Features/Scenarios, although "only failed tests" is selected
- Feature request: Provide a @ScenarioScoped annotation HOT 1
- All contributors HOT 6
- Feature Request/ Question: Run tests as Integration Tests HOT 16
- Execute cucumber test from custom module HOT 2
- getTests() displayName must not be null or blank HOT 1
- Configure quarkus profile/properties in a feature file
- Alternative Beans not properly resolved
- @CucumberOptions annotation not detected when quarkus creates a _Subclass proxy
- Running cucumber scenarios in parallel? HOT 3
- How to fail a step when testing a Uni? HOT 1
- A working example of a Uni test HOT 4
- Where should I put the @BeforeAll and @AfterAll ? HOT 7
- Support for Cucumber Java 8 Lambda Definitions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quarkus-cucumber.