Tyler-Keith-Thompson / CucumberSwift

A lightweight swift Cucumber implementation
https://tyler-keith-thompson.github.io/CucumberSwift/documentation/cucumberswift/
MIT License
74 stars 19 forks source link

CucumberTest no longer discovered by Xcode #74

Closed Tyler-Keith-Thompson closed 1 year ago

Tyler-Keith-Thompson commented 1 year ago

Xcode no longer detects and runs CucumberTest automatically. So anybody new trying to adopt CucumberSwift is doomed to failure.

Potential fix

If we make the CucumberTest class open we can have consumers inherit from it, forcing discovery

Consequence

Test parallelization will no longer work (it never really has for UI testing targets)...we can deal with that problem a little later. I think we can go back to using Principal Class for the purpose of swizzling the correct methods to get test parallelization, and use the potential fix method for anybody who doesn't care about parallel test execution.

Additional

It's not just CucumberTest, the ObjC "load" method isn't being called either. Other testing libraries may have run into this problem, I'll be investigating them, cause using that load method was a popular way of injecting tests.

We'll need to rev the major version to try and indicate the breaking change. What's weird is that people who already set up CucumberSwift aren't reporting problems and my test harness still works, so this might have something to do with new projects? It's hard to say.

Tyler-Keith-Thompson commented 1 year ago

Possibly related? https://github.com/Quick/Quick/issues/1190

Tyler-Keith-Thompson commented 1 year ago

This is fixed in 4.0.1, Please adapt your code to have some class that inherits from CucumberTest, try this:

public var bundle: Bundle {
    class TestDiscovery: CucumberTest { }
    return Bundle(for: TestDiscovery.self)
}