Cucumberish
Cucumberish copied to clipboard
When can we expect the support for the Xcode 10.1 & Swift 4.2?
In our organisation we are currently using the Xcode 10.1 & Swift 4.2, and we are using the Cucumberish, so, when can we expect the support for this? @Ahmed-Ali
@Ahmed-Ali : Sir, any update. Is Cucumberish supporting the Swift4.2?
@Ahmed-Ali : Any update on supporting the Swift4.2?
@Ahmed-Ali : Sir any update?
Hi there, I'm using Xcode 10.1 swift 4.2 with Cucumberish let me know what sort of errors are you seeing
I've been using it with Xcode 10.1/Swift 4.2 and Xcode10.2/Swift 5. With my setup I just don't create the bridging header when adding the .m file and things seem to work pretty well for me.
I also had to make the swift class loading the feature files accessible from objective-c. See the extra two lines adding @objc
.
import XCTest
import Foundation
import Cucumberish
@objc public class CucumberishInitializer: NSObject {
@objc public class func CucumberishSwiftInit()
{
let bundle = Bundle(for: CucumberishInitializer.self)
Cucumberish.executeFeatures(inDirectory: "features", from: bundle, includeTags:nil, excludeTags: nil;)
}
}
What issues are you being with Xcode 10.1 and Swift 4.2?
@sidekickr Do you have any examples available for viewing using Xcode 10.2/Swift 5? I am rather new to IOS/swift and trying to compare Detox, XCUITest, and Appium but I need the cucumber integration as well.
I was able to implement what you have listed here which helped clear up a few errors. But not sure how/where too step up my given when tests.
@Srutherford2407 I don't have any small samples that I can share, but I can provide some more guidance. The code I posted will read in the feature files, parse them and execute them. It doesn't cover the loading step definitions. I typically create one or more classes that implement the step definitions.
If the class is named MyProjectStepDefs then I would load it like so before calling executeFeatures.
let steps = MyProjectStepDefs()
steps.setupSteps()
where MyProjectStepDefs might be defined like this:
class MyProjectStepDefs {
var testVariables : TestVariables
init() {
testVariables = TestVariables()
}
func setupSteps() {
before { (scenario) in
self.testVariables = TestVariables()
self.setupGivenSteps()
self.setupWhenSteps()
self.setupThenSteps()
}
after { (scenario) in
//reset code
}
}
}
extension MyProjectStepDefs {
func setupGenericGivenSteps() {
// MARK: step 1
Given("^step1") { (args, hashes) in
}
}
}
Beyond the generic step definitions I'll do extensions to the class for each section of the application that needs specific step definitions to help organize them. I like using a test variables class to be able to pass information between steps. It can help with verification.
Hope this helps a bit.
Hi Guys, has anybody tried it with Xcode 10.2.1 and swift 5?
@olyv : I have. Working perfectly fine with Xcode 10.2.1 and swift 5.
hi @ nagashreeabhilash100, got it working with Xcode 10.2.1 and swift 5. Thanks for response
@nagashreeabhilash100 @olyv Do either of you have an example you could possibly share?
@Srutherford2407 what sort of problems are you running into?
@Srutherford2407 this is an example https://github.com/depoon/WeatherCucumber I followed