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

Update cucumber.rb #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update cucumber.rb #105

wants to merge 1 commit into from

Conversation

SkylerBleu
Copy link

@SkylerBleu SkylerBleu commented Feb 27, 2019

Hello, I'm requesting this extra regex option get added to cucumber.rb to fix an issue I'm having with Scenario Outlines.

Here is an example:

Scenario Outline: Example of scenario outline issue
      Given User makes GET request to "www.give-me-a-json.com/api/json"
      And   User receives 200 response code
      Then  the JSON response at "data/someInteger" should be <integer>
      
      Examples:
      | integer |
      | 5       |

^^^ The above will give me an undefined step reference error while conversely....

Scenario: Example of scenario outline issue
      Given User makes GET request to "www.give-me-a-json.com/api/json"
      And   User receives 200 response code
      Then  the JSON response at "data/someInteger" should be 5

This will work fine. Adding <.*> will allow for examples table entries to be read, regardless of quotations. It's also an improvement because if the value passed in by the examples table doesn't follow the regex, then it will throw a runtime error.

Hello, I'm requesting this extra regex option get added to cucumber.rb to fix an issue I'm having with Scenario Outlines.

Here is an example:
```
Scenario Outline: Example of scenario outline issue
      Given User makes GET request to "www.give-me-a-json.com/api/json"
      And   User receives 200 response code
      Then  the JSON response at "data/someInteger" should be <integer>
      
      Examples:
      | integer |
      | 5       |
```
^^^ The above will give me an undefined step reference error while conversely.... 
```
Scenario: Example of scenario outline issue
      Given User makes GET request to "www.give-me-a-json.com/api/json"
      And   User receives 200 response code
      Then  the JSON response at "data/someInteger" should be 5
```
This will work fine. Adding <.*> will allow for examples table entries to be read, regardless of quotations. There may have to be an extra check within the method to account for someone trying to pass in a string without quotations using the examples table, which I'd be happy to provide if requested.
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

Successfully merging this pull request may close these issues.

1 participant