Skip to content
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

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

Open
nagashreeabhilash100 opened this issue Feb 15, 2019 · 13 comments
Open

Comments

@nagashreeabhilash100
Copy link

nagashreeabhilash100 commented Feb 15, 2019

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
Copy link
Author

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

@nagashreeabhilash100
Copy link
Author

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

@nagashreeabhilash100
Copy link
Author

@Ahmed-Ali : Sir any update?

@idelfonsog2
Copy link
Contributor

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

@sidekickr
Copy link
Contributor

sidekickr commented Apr 10, 2019

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?

@Srutherford2407
Copy link

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

@sidekickr
Copy link
Contributor

sidekickr commented Jun 12, 2019

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

@olyv
Copy link

olyv commented Jun 26, 2019

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

@nagashreeabhilash100
Copy link
Author

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

@olyv
Copy link

olyv commented Jun 26, 2019

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

@Srutherford2407
Copy link

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

@sidekickr
Copy link
Contributor

@Srutherford2407 what sort of problems are you running into?

@olyv
Copy link

olyv commented Jun 28, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants