Cucumberish icon indicating copy to clipboard operation
Cucumberish copied to clipboard

When can we expect the support for the Xcode 10.1 & Swift 4.2?

Open nagashreeabhilash100 opened this issue 6 years ago • 13 comments

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

nagashreeabhilash100 avatar Feb 15 '19 05:02 nagashreeabhilash100

@Ahmed-Ali : Sir, any update. Is Cucumberish supporting the Swift4.2?

nagashreeabhilash100 avatar Feb 20 '19 08:02 nagashreeabhilash100

@Ahmed-Ali : Any update on supporting the Swift4.2?

nagashreeabhilash100 avatar Feb 25 '19 09:02 nagashreeabhilash100

@Ahmed-Ali : Sir any update?

nagashreeabhilash100 avatar Mar 12 '19 00:03 nagashreeabhilash100

Hi there, I'm using Xcode 10.1 swift 4.2 with Cucumberish let me know what sort of errors are you seeing

idelfonsog2 avatar Mar 26 '19 17:03 idelfonsog2

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 avatar Apr 10 '19 17:04 sidekickr

@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 avatar Jun 11 '19 22:06 Srutherford2407

@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.

sidekickr avatar Jun 12 '19 12:06 sidekickr

Hi Guys, has anybody tried it with Xcode 10.2.1 and swift 5?

olyv avatar Jun 26 '19 09:06 olyv

@olyv : I have. Working perfectly fine with Xcode 10.2.1 and swift 5.

nagashreeabhilash100 avatar Jun 26 '19 09:06 nagashreeabhilash100

hi @ nagashreeabhilash100, got it working with Xcode 10.2.1 and swift 5. Thanks for response

olyv avatar Jun 26 '19 12:06 olyv

@nagashreeabhilash100 @olyv Do either of you have an example you could possibly share?

Srutherford2407 avatar Jun 27 '19 15:06 Srutherford2407

@Srutherford2407 what sort of problems are you running into?

sidekickr avatar Jun 27 '19 15:06 sidekickr

@Srutherford2407 this is an example https://github.com/depoon/WeatherCucumber I followed

olyv avatar Jun 28 '19 13:06 olyv