-
Notifications
You must be signed in to change notification settings - Fork 19
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
Steps are reported as passing although the step definition's closure is XCTFail #87
Comments
Thanks to a break in Xcode 14.something the way you define the test bundle had to change. Can you try:
I'm hoping that resolves your issue and the weird behavior can be explained by Xcode weirdness. |
Thanks so much for your reply. I'm using CucumberSwift inside of a Swift Package. In other words, I'm using it not in an xcodeproj, but to test a swift package I'm writing. I had to use |
Sure, I'd expect the feature files to be found but inheriting from CucumberTest actually sets up some of the XCTestObservation stuff. So given you've got the use-case of only doing this as part of a
In the meantime I'll try to repro your setup, hadn't ever tried using this without an xcodeproj before but it's totally a use-case we should support. |
Thank you, I've added that XCTestCase, but it doesn't make a difference. It seems like if one step inside of a scenario fails, the remaining steps in that scenario are reported as successfully passing, although their matching step definition closures are not executed (I set breakpoints to verify that). |
Just wanted to circle back, I haven't forgotten about this, I've just been swamped. I've got reason to suspect this is Xcode being eccentric. Curious if 14.3 has any different behavior. |
Running into the same issue here, it almost seems as if the matchers don't work correctly at all in a standalone Swift package. If I use Bundle.module the feature file is discovered properly but tests continue to claim no steps are implemented, and all tests pass. |
Is your feature request related to a problem? Please describe.
I have multiple step definitions, and currently they all just execute
XCTFail
. However, two out of three of my feature steps are reported as successful tests. I would expect all tests to be reported as failures in Xcode. Also,continueTestingAfterFailure
istrue
.Describe the solution you'd like
I would expect all steps that have a matching step definition to be reported as failures if the closure of those step definitions is running
XCTFail
.Describe alternatives you've considered
I've removed
XCTFail
from the first step definition. When I do that, the first step passes and then the 2nd step fails and the 3rd step is reported as a success again.Also,
continueTestingAfterFailure
doesn't seem to make a difference.Additional context
My step definitions:
The feature:
The Xcode output:
The text was updated successfully, but these errors were encountered: