Closed ysnnzlcn closed 1 year ago
Apologies for the late response, I've had some surgeries that took me out of commission for quite a while.
Q: Is there a way to group them under the func name? Why does every step look like another test case? A: Because XCTest is not even remotely friendly to tie into. The only way to do it is to use the Objective-C runtime and dynamically create classes. So that's what CucumberSwift does. This causes all of the behaviors you've witnessed. There isn't a way to group them per se...but there are 3 workarounds.
.feature
files, which depending on your team structure and desire to work with other Cucumber implementations, might not be practical.Q: Is it possible to run any test seperately? Right now if i run any test separately, it gets succeeded without running cucumber steps but if i run them all (cmd+U) cucumber works.
A: Yeah, that's because the classes are dynamically created, and so rerun
can't actually find the class to run. There is a workaround with the shouldRun method. NOTE: This will be moved to DocC when I have time. These docs show how you can run by line number, but you have the scenario object, so run by whatever criteria you want, tags, line, scenario title, whatever.
Q: When i run tests from the terminal and CI/CD, cucumber also doesn't work. Is there a documentation to follow for this implementation? A: That's weird...I run by CI/CD all the time. In fact this whole library can only deploy if that works. I'd need way more info on what you're trying to do. Short answer: If you use xcodebuild to run your tests, you should be fine.
@Tyler-Keith-Thompson No problem man, thank you for responding. I have handled the terminal issue and will try your suggestions. I will close this issue and reopen it if i get stuck in the future. Thanks again 🙏
Hi, i am trying to implement this to my project but there are some concepts that i can't understand. I read the docs and checked the CucumberSwiftSample but it didnt help.
How i use it:
As you can see in the image I defined steps inside the test func and expect them to be grouped in the test results with a big T but every single step looks like they are a separate test. My questions are: