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

Current snapshot implementation does not work with scenario outlines #24

Open
plouc opened this issue Feb 16, 2018 · 2 comments
Open

Current snapshot implementation does not work with scenario outlines #24

plouc opened this issue Feb 16, 2018 · 2 comments
Assignees
Labels

Comments

@plouc
Copy link
Contributor

plouc commented Feb 16, 2018

Steps to reproduce

Having a scenario like this:

    Scenario Outline: I get all posts filtered using '<filter>=<value>' directive
        Given I set request query
            | <filter> | <value> |
        When I GET /api/v1/posts/all
        Then response status code should be 200
        And response body should match snapshot

        Examples:
            | filter | value           |
            | title  | car industry    |

Current behavior

Running this test, I end up with the following error:

Error: Can not do a snapshot. Scenario not found in file test/functional/features/posts/get_posts.feature on line 13

Expected behavior

Test running :)

Environment

  • node version: 8.5.0
  • cucumber version: 2.3.1
  • @ekino/veggies version: 0.6.0
@plouc plouc added the bug label Feb 16, 2018
@plouc plouc changed the title Current snapshot implementation does work with scenario outlines Current snapshot implementation does not work with scenario outlines Feb 16, 2018
@lelbil
Copy link

lelbil commented Mar 1, 2018

Hello @plouc

if @bnadim is busy, I can have a try at this.
I've been digging around and apparently, Snapshot class method extractScenarios only matches /^[\s]*Scenario:[\s]*(.*[^\s])[\s]*$/, so when it's a Scenario Outline it doesn't match. Moreover, the line number for a single scenario in the outline, is the line number where the example is specified.

Anyway, I can give it a shot if that doesn't bother you.

@plouc
Copy link
Contributor Author

plouc commented Mar 7, 2018

@lelbil, no problem, depending on your planing of course :)

pebie pushed a commit to pebie/veggies that referenced this issue Nov 8, 2022
….0.3

chore(deps): bump y18n from 4.0.0 to 4.0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants