Comments (4)
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.
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.
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.
Very nice!
from cucumberswift.
Related Issues (20)
- Need help with setting up CucumberSwift HOT 2
- Add a screenshot to scenario in AfterScenario HOT 1
- Call another step from current HOT 2
- "Given something #comment" vs "Given the color is #123456" HOT 4
- Stub generation uses deprecated Matcher initializer HOT 1
- Couldn't execute tests/run project - x86_64-apple-macos vs arm64-apple-macos issue HOT 3
- Quoted string works incorrect in scenario outline when there is a parameter HOT 6
- Group steps per scenario in test report HOT 2
- CucumberTest no longer discovered by Xcode HOT 2
- Some tests are not passing because generated code is localised.
- Wrong order of hooks execution. HOT 1
- Usage of symbols < and > in data table produce errors in non Outline Scenarios. HOT 6
- Broken Gherkin language support due to 951bdd3a48900e24d528f0ac65814e2a06dbfdb5 HOT 2
- Empty cell in table error HOT 3
- Steps are reported as passing although the step definition's closure is XCTFail HOT 6
- Scenarios are running 2 times HOT 8
- @ in steps causes error HOT 2
- Couldn't load project from derived data HOT 7
- Compiled module was created by a different version of the compiler
- Error if comment is placed after tag HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cucumberswift.