-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Deprecate And
and But
functions for step definitions
#821
Comments
These aren't available in cucumber-js and therefore won't be here either. This fixes #821.
These aren't available in cucumber-js and therefore won't be here either. This fixes #821.
These aren't available in cucumber-js and therefore won't be here either. This fixes #821.
Fixed with v13.0.0. |
Wow. This is a huge breaking change, isn't it? Could you please explain, why I also have those reusable steps in different files like |
You thinking this make me suspect that you're misunderstanding the implications of this change. This only affects the method you use for defining steps, aka However, with a file a Feature:
Scenario:
Given something
And another thing .. then Thus, the only thing I expect anyone to change is swapping out calls to |
Ah, now I understand. But in German this does not work. The sentence structure after But I already found a workaround. I just use
|
FYI, |
I guess this means that my workaround will get quite ugly then, e. g. mapping everything to |
@iomedico-beyer can you give me a concrete example of a sentence/step that would be different with |
Sure :)
is in German
Subject and predicate swap places. A linguistic alternative would be to add a "dann " to the
However, that sounds more than a little odd. |
woulnd't it be better to support defining steps as both 'When' and 'And' like other bdd frameworks? |
I guess the idea is that Also the framework can narrow its matching to look e. g. only in |
Recommended reading: A little tense |
Interesting! Here is a typical test of mine translated into English and trying to follow that guide:
So for the clicking steps I would have to implement the "clicked" variant with the Sorry if that's awfully off topic! |
I agree this was hastily implemented. This feels a bit too opinionated from the author. |
what a shame, AND/OR is widely used in Gherkin sintax and should reflect in the tests. |
Furthermore, |
I want to highlight the following comment from Mar 16, 2021: cucumber/cucumber-js#1615 (comment)
|
@badeball , E.g.
Code:
Making it also easier to understand if the command is a |
are you still using this method? where did u place this, in your step definition fille? |
No, in the end we switched to English.
No, somewhere in |
Current behavior
Step definitions can be defined with
Given
,When
,Then
,And
andBut
- seecypress-cucumber-preprocessor/lib/index.ts
Lines 65 to 71 in b629567
Desired behavior
Step definitions can be defined with
Given
,When
andThen
. This is what Cucumber.js does: https://github.com/cucumber/cucumber-js/blob/01368ca6e3c9b097a7a88bb72de5beeddb4a0326/src/index.ts#L45-L51Here is an example illustrating why:
With the currentl API, people might implement step definitions this way:
But what if I add a new scenario:
It no longer makes sense that the step defnition is defined with
And
.The
And
andBut
keywords only belong in Gherkin. Step definitions are reusable in any order, and should therefore not useAnd
andBut
.Checklist
cypress-cucumber-preprocessor@4.3.1
(package name has changed and it is no longer the most recent version, see #689).The text was updated successfully, but these errors were encountered: