Skip to content

Add cucumber code snippet #799

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

Closed
3 tasks
iso13 opened this issue Aug 15, 2022 · 8 comments
Closed
3 tasks

Add cucumber code snippet #799

iso13 opened this issue Aug 15, 2022 · 8 comments

Comments

@iso13
Copy link

iso13 commented Aug 15, 2022

Current behavior

Desired behavior

Test code to reproduce

Versions

  • Cypress version:
  • Preprocessor version:
  • Node version:

Checklist

@badeball
Copy link
Owner

Elaborate.

@iso13
Copy link
Author

iso13 commented Aug 15, 2022

Reference: https://github.com/cucumber/cucumber-js/blob/main/docs/snippets.md

Being lazy and efficient.
As well as an opportunity for people new to cucumber to get on boarded quickly.

In most standard cucumber frameworks you can run cucumber steps, which are missing step definitions, execute the scenario via terminal and it will provide a cucumber snippet.

? Given I do something
Undefined. Implement with the following snippet:

     Given('I do something', async function () {
       // Write code here that turns the phrase above into concrete actions
       return 'pending';
     });

@badeball
Copy link
Owner

Closely related to #754, where I actually have implemented snippet suggestions. I don't have time to continue on it right now though.

badeball added a commit that referenced this issue Sep 16, 2022
badeball added a commit that referenced this issue Sep 16, 2022
badeball added a commit that referenced this issue Sep 16, 2022
@badeball
Copy link
Owner

This has been introduced with v13.0.0.

@uo9qsuf
Copy link

uo9qsuf commented Feb 14, 2023

@badeball Thank you,

but if I wirte When or Then I get always a Given as suggestion. And the placeholder for string etc. aren't inside the suggestion. Can you extend the feature?

@badeball
Copy link
Owner

And the placeholder for string etc. aren't inside the suggestion.

What do you mean by this?

@uo9qsuf
Copy link

uo9qsuf commented Mar 23, 2023

@badeball here an example

Scenario: test
   Given here a text with content "hallo world"

the suggestion should be link this

Given(here a text with content {string}', (value) => {
       // Write code here that turns the phrase above into concrete actions
       console.log('value', value)
       return 'pending';
     });

@badeball
Copy link
Owner

I've opened a separate issue with this here. Feel free to take a stab at this yourself.

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

No branches or pull requests

3 participants