-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ErrorCollector is not working for me - can it run using Cucumber Runner class? #983
Comments
I just discovered that @aslakhellesoy says this is not supported back in 2013, (https://groups.google.com/forum/#!msg/cukes/qMwgAVzWmR0/GSkRUgJ8f4EJ) can we get a "Run Rule Check" like method so I can manually call the step that JUnit calls in my @after step? |
You can call |
Verify is protected, I cannot call from my After step directly. |
I don't think this is a JUnit issue. There is a closed one over at cucumber-jvm: cucumber/cucumber-jvm#393. |
I may need to close this thread since its already off topic.... But, just to clarify, while I initially thought this was a bug in Junit. Its actually a Design Decision in Cucumber JVM at the moment. I stand corrected on that point. However, since cucumber isn't doing this for me, I would like to execute the ErrorCollector verify function myself in Cucumber.After step. I am not saying that Verify should be public instead of protected, however, this would solve my issue and allow me to work around this design decision. |
Well, for now you could create a subclass of |
For some reason that didn't work, but, I just basically copy and pasted your files into my project. I must have done something wrong but at least now I have more control over whats happening :) |
Would it help you if we made |
Did someone ever send a pull request to Cucumber to add Rule support? They
|
@kcooney - cucumber/cucumber-jvm#771 (comment) I think they are open to it now :) I was going to take a peek at this over the weekend, but if you want to take a stab I say go for it! Edit: Updated comment reference |
@JasonSmiley sadly I don't have time to contribute to yet another open source project, but I would be happy to help review the changes when you think they are ready |
I'll take a stab and let you know. |
I'm closing this issue for now. Feel free to add a comment or refernce it from your cucumber-jvm pull request. |
Before I do anything, can someone point me in the right direction in terms of what JUnit code i should look at to see how Rules are being checked? I figure the cucumber runner will need something similar. Just figured I would ask :) |
I'm sorry my comment wasn't that helpful @JasonSmiley, I didn't notice that Edit: Looking at how other library (namely Spring and Mockito) implement their runners (which are compatible with |
Please make verify public. I am having the same issue and running it with testng. |
@sarpk are you using cucumber? If so, I suggest commenting on the cucumber bug. If not, can you provide a simple reproducible test case? |
@kcooney no I am using testng not cucumber. testng already has soft asserts which works exactly like that (where you call it's verify method when you want to) |
@sarpk sorry, you said that in your post, and I misread it. Users that use JUnit shouldn't need to call |
ErrorCollector doesn't seem to work, even when I do the most basic test.
See code:
Note, I am using Cucumber JVM to run my tests.
The text was updated successfully, but these errors were encountered: