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

Scenario outline doesn't work inside a Rule scope #86

Closed
wucke13 opened this issue Nov 7, 2020 · 5 comments
Closed

Scenario outline doesn't work inside a Rule scope #86

wucke13 opened this issue Nov 7, 2020 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@wucke13
Copy link

wucke13 commented Nov 7, 2020

I tried to make an secnario outline - it didn't work. I'm not sure whether this is relevant, but it resides inside a Rule. Looking at the matches I seems to just put the placeholder
<name of a col in the Examples table> instead of a value from the regarding table. How is this supposed to work?

This is a minimal example to reproduce the issue:

Feature

Feature: Guinea Pig
This feature was made to be abused!

  Rule: To them all

    @SomeTag
    Scenario Outline: Parse a Number
      Given the rate of rage is at least <rate of rage> feet per minute
      When the pressure of caviar is most <pressure> miles
      Then tea might help

      Examples:
        | rate of rage | pressure |
        | 1200         | 42       |
        | 2200         | 48       |
        | 3200         | 3        |

Step Definition

.given_regex(
    r"the rate of rage is at least (\d+) feet per minute",
    |world, matches, _step| {
        panic!("{}", matches[1]);
        world
    },
);

Output

Feature: Guinea Pig                                                     features/guinea_pig.feature:1:1 

 Rule: To them all                                                      features/guinea_pig.feature:4:3 
  Scenario: Parse a Number                                              features/guinea_pig.feature:8:5 
   - Given the rate of rage is at least <rate of rage> feet per minute  features/guinea_pig.feature:9:7 
     ⚡ Not yet implemented (skipped)

Changing the (\d+) to (.+) reveals:

Output

Feature: Guinea Pig                                                     features/guinea_pig.feature:1:1 

 Rule: To them all                                                      features/guinea_pig.feature:4:3 
  Scenario: Parse a Number                                              features/guinea_pig.feature:8:5 
   ✘ Given the rate of rage is at least <rate of rage> feet per minute  features/guinea_pig.feature:9:7 
———— [!] Step failed: ————————————————————————————————————————————————————————  test/cucumber.rs:111:17 
  <rate of rage>
———————————————————————————————————————————————————————————————————————————————————————————————————————

The placeholder rate of rage is not replaced by an actual number from the table.

@bbqsrc
Copy link
Member

bbqsrc commented Nov 9, 2020

Closing in favour of #64.

@wucke13
Copy link
Author

wucke13 commented Nov 10, 2020

The fixes which claim to solve #64 are not making this work, hence I would like to have this issue reopened @bbqsrc

@wucke13
Copy link
Author

wucke13 commented Nov 10, 2020

And I can confirm that this issue is caused by the Rule: part. Removing it makes it work with latest master. So @bbqsrc , this indeed is not the same issue a #64 . Unfortunately I can't re open this issue, as you closed it.

@bbqsrc
Copy link
Member

bbqsrc commented Nov 10, 2020

Right, then it's a slightly different issue. Will reopen. 😄

Seemingly, the next obvious step to fix this issue then is to replicate the logic under the rule handling part of the code.

@bbqsrc bbqsrc changed the title Scenario outline doesn't work Scenario outline doesn't work inside a Rule scope Nov 10, 2020
@bbqsrc bbqsrc reopened this Nov 10, 2020
@bbqsrc bbqsrc added bug Something isn't working help wanted Extra attention is needed labels Nov 10, 2020
@bbqsrc bbqsrc added this to the v0.8 milestone Dec 2, 2020
@tyranron tyranron removed the help wanted Extra attention is needed label Sep 27, 2021
@tyranron
Copy link
Member

Fixed in #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants