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

{string} from example table does not work unless using quote: '<myStringFromTable>' #664

Closed
vince-ee opened this issue Jan 14, 2022 · 2 comments

Comments

@vince-ee
Copy link

vince-ee commented Jan 14, 2022

Current behavior

Scenario:

   ...
    Then this <stringFromTable> is displayed
    Examples:
        | stringFromTable | 
          abcdef

Code:

Then("this {string} is displayed", (myValue) => {
    cy.log('The value is: '+myValue)
})

Result:
Step implementation missing for: this abcdef is displayed

Desired behavior

It should find the step and print The value is abcdef

It works if adding quote in scenario:

Then this '<stringFromTable>' is displayed

Which is not correct regarding Gherkin syntax.

However there is no issue with {int}:

   ...
    Then this <myInt> is displayed
    Examples:
        | stringFromTable | 
          1234

Code:

Then("this {int} is displayed", (myValue) => {
    cy.log('The value is: '+myValue)
})

Then this 1234 is displayed

Versions

  • Cypress version: 9.1.0
  • Preprocessor version: 4.3.0
  • Node version: Node.js v17.2.0
@amitguptagwl
Copy link

@vince-ee I believe this is the cucumber expression behavior that the string data should be wrapped in single/double quotes. This is not the framework issue. Check this for an example

@badeball
Copy link
Owner

Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far.

Read more about the transfer of ownership here.

The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.

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

3 participants