Add descriptions support for the nodes: ExampleTable, Outline and Sce…#254
Add descriptions support for the nodes: ExampleTable, Outline and Sce…#254jojo1981 wants to merge 2 commits intoBehat:masterfrom
Conversation
|
This looks great! How does it change the output of the pretty printer in Behat, though? As long as it's just that the descriptions are cleanly omitted I think that's fine? |
| @@ -437,6 +438,7 @@ protected function parseOutline() | |||
| $token = $this->expectTokenType('Outline'); | |||
|
|
|||
| $title = trim($token['value'] ?? ''); | |||
There was a problem hiding this comment.
why removing the trimming for scenario but not for outline ?
There was a problem hiding this comment.
I thought to make it compatible with the CompatibilityTest for the descriptions.feature.
I now see this is NOT the case. I will fix this.
There was a problem hiding this comment.
Reverted the trim scenario title functionality.
|
This might impact the pretty printer ignoring description because previously, that description would be parsed as a multi-line title (and so displayed). |
|
I didn't check that, but as this change is not backwards compatible based on functionality a new major version should be released including this feature. |
|
@jojo1981 thanks very much for this contribution and I'm sorry it was stalled for so long. We're working on introducing this behaviour through an opt-in Because of that, and because there have been quite a few changes in the project since you opened this, I've started a new implementation in #361 rather than building on the commits you already have here. Therefore I'm going to close this PR, but it's been helpful to read through your code as a starting point and I will be sure to credit your contribution in the upcoming release. Thanks! |
Historically, we have not supported parsing descriptions as a separate concept for Examples, Background, Scenario or Scenario Outline. Text following the keyword line was instead parsed as a multi-line title. This PR implements support for instead capturing these as standalone properties when running in cucumber/gherkin compatibility mode. This borrowed from and builds on work done by @jojo1981 in #254, but started from a clean branch as there have been a lot of changes since that PR was opened. Fixes #154 #211
Now the
descriptions.featuresample in CompatibilityTest will work.The code is backward compatible.