veggies
veggies copied to clipboard
Current snapshot implementation does not work with scenario outlines
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
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.
@lelbil, no problem, depending on your planing of course :)