-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
PickleLineFilter
doesn't work with absolute paths
#1900
Comments
Mmh. I would expect Cucumber to identify pickles by the the argument provided and not turn absolute urls into relative ones. Is there a reason feature paths in the current working would have to be made relative? |
It's hard to tell, perhaps because Cucumber prefers |
Yeah the URIs on the Gherkin messages are relative to I think providing absolute paths is an under-tested use case for us to date. I'm not sure how best to address this offhand but will take a look. And yeah I expect #1783 is at least somewhat related. |
… number they're on Serenity/JS now ensures that any paths to feature files given to Cucumber are relative from Cucumber's current working directory. This helps to work around cucumber/cucumber-js#1900 Re protractor-cucumber-framework/protractor-cucumber-framework#238
Released in 8.4.0 https://github.com/cucumber/cucumber-js/releases/tag/v8.4.0 |
Describe the bug
Cucumber ignores line filter when the feature file is described using an absolute path:
So this works:
But this doesn't work and all scenarios from
example.feature
are executed, not just the one on line3
:Original issue reported at protractor-cucumber-framework/protractor-cucumber-framework#238
Possibly related:
To Reproduce
Please have a look at the repository where I'm demonstrating the issue.
I think the issue comes down to this:
featurePaths
are absolute, so[ '/Users/jan/cucumber-demo/features/example.feature:3' ]
PickleLineFilter
, which createsfeatureUriToLinesMapping
as follows:PickleFilter
checks withPickleLineFilter
if a givenpickle
matchesAnyLine
, it provides it with a relativepickle.uri
Proposed solution
I think that since
PickleLineFilter
has access tocwd
(which it seems to be ignoring at the moment) it might be useful to ensure that both thefeatureUriToLinesMapping
andmatchesAnyLine
rely on absolute paths.Expected behaviour
Line number filters should work for both relative and absolute paths.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: