Support for Doc String type
Opened this issue · 3 comments
Hi all,
I am trying to implement a step which feature file looks like:
Scenario Outline: something something
Given an individual customer with an account
....
Then a warning tile will display the following message:
"""
Lorem ipsum etc etc
Lorem ipsum line 2
"""
Following this documentation https://cucumber.io/docs/gherkin/reference/#doc-strings I assumed this argument is passed just like a Data Table, so I create my step like this:
Then('a warning tile will display the following message:', async (t, ...docString) => {
console.log(docString);
});
This step works, but the console.log() results in [ [], null ]
I have looked in a lot of documentations, but I can't find anything that could help me.
Is Doc String supported ? And if so, what is the correct usage?
Thanks!
Hi @Dreun,
no, doc strings are not supported, unfortunately.
Thanks for the quick response. If I was to build it myself, could you give me some pointers where to start?
You would need to modify gherkin-testcafe to pass this parameter to your step implementation.
If you are brave enough to do it:
- Extract the doc string from the compiled step the same way it is done here for data tables
- Pass the result to
_runStep
here - Pass the doc string to the step implementation here
- Do not forget to adjust the type definitions: https://github.com/kiwigrid/gherkin-testcafe/blob/master/index.d.ts#L35