Code Monkey home page Code Monkey logo

Comments (4)

Tyler-Keith-Thompson avatar Tyler-Keith-Thompson commented on June 1, 2024 2

Update on this: CucumberSwift v 3.3.6 adds support for using Given, When, or Then to match gherkin that started with And or But. It is scoped appropriately.

EXAMPLE GHERKIN:

Feature description
    Scenario: Description
        Given some precondition
        And some other precondition

EXAMPLE SWIFT:

Given("some other precondition") { _, _ in
    // executes the "And" condition
}

NOTE: By scoped appropriately I mean that this Gherkin will not match Given

Feature description
    Scenario: Description
        And some other precondition

Although because the And/But keywords still exist, they can match that.

from cucumberswift.

Tyler-Keith-Thompson avatar Tyler-Keith-Thompson commented on June 1, 2024 1

I've looked at some other implementations and confirmed that CucumberSwift is not following defined and expected behavior with this. I don't want to create a breaking change if I can avoid it so I'm pondering some implementation decisions.

I'm thinking of doing this over a few releases, to start we can implement the behavior in your example of Given("test123") And still ends up being a dedicated keyword but you start to get some of the desired behavior from the library.

Then we'll play with the * keyword which currently does sort of work for everything, but probably needs to be smarter when it should be treated more like an And.

Then we'll deprecate, but not remove And as an entity outside of the DSL.

At some point later on in life when V4 needs to be a thing we can just remove it altogether.

from cucumberswift.

Tyler-Keith-Thompson avatar Tyler-Keith-Thompson commented on June 1, 2024

Hrm, I think you’re right about the behavior of “and” and “but”. Let me look at the spec and some other implementations over the weekend.

If we do implement this feature it’s probably something we would want to approach in the AST where we can enforce an error if there are orphans.

from cucumberswift.

esemusa avatar esemusa commented on June 1, 2024

Very nice! 😊

from cucumberswift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.