-
-
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
Scenario outline with examples in title #267
Comments
+1 I had a look in some upstream projects to try figure out what the current behaviour is and therefore where this request could go. The closest behaviour is the --expand option for the cucumber formatter which appears to produce something along the following lines: Scenario Outline: A <some> step is <result>
When a <some> step
Then I get <result>
Examples: Scenario: | passing | passed |
When a passing step
Then I get passed
Scenario: | failing | skipped |
When a failing step
Then I get skipped That said, I'm not sure where a request to change this behaviour should go. Perhaps @jbpros or @aslakhellesoy can help direct this. |
+1 |
+1, this would greaty increase the readability of scenario outline names. |
I like it! +1 |
For the record: I don't like Scenario Outlines. They are a smell that usually means you should write unit tests instead. That's where permutation testing belongs. |
Let me repeat it: I don't like scenario outlines either! That being said, this is a nice suggestion within the scope of scenario outlines. Please send a PR. |
-1 I think gherkin documents work best if each element has a meaningful, human readable name. Scenario outlines have a place - sometimes tabular data is the best way to illustrate behaviour - but the placeholders and substitutions are a big impediment to readability. pushing that impediment up out of the steps of the outline and into its title is too far, IMO. |
Good point @mattwynne. |
I think it's easier to discuss pros and cons of this feature with some real examples rather than toy ones. Who can convince @mattwynne ? |
I think this suggestion has a very strong place within the Scenario Outline feature as it exists today. Happy to create a PR for this once the behaviour is agreed. Scenario Outlines serve to reduce repetition in gherkin documents by acting as templates for generated scenarios. While I agree that this abstraction can reduce readability in some circumstances, it can also be used to improve readability and I'm certain that it can improve maintainability.
At the other end of things in test result land (and spec browser land), the value added by unique and meaningful scenario names seems too good to ignore.
As an aside, I think that most edit-time issues can be improved by better editors. Keyword colouring and indenting goes a long way in most languages but some sort of live preview feature can aid comprehension where templates are concerned. The other item that deserves some consideration is what might happen if there are multiple Examples blocks. Should the example block name be incorporated in the generated scenario name somehow? Tacked on the end? Substituted with example values? Out of scope for this PR? I have never used multiple example blocks so I don't think I'm in a position to comment. |
When this feature will be released? |
I just realised Cucumber-JVM already does this. I can't remember if I implemented that myself or if it was someone else. Thanks for the heads up @brasmusson ! |
Thanks @aslakhellesoy, I've sent a PR across, let me know if you need any alterations. |
This feature will help me very much. Any ETA when this will be released? I have copied source code and it is working fine, but it would be good to have it in npm install. |
Hi, just a gentle nudge to @jbpros, @mattwynne and @aslakhellesoy on this. It would be great if we could get some feedback on the PR. Thanks |
If this behaviour is already in Cucumber-JVM, and people want it here, I'm not going to stand it it's way. Merge on! Don't expect me to rush to implement it in Ruby though 😀 |
@chrismilleruk can you rebase off master please? |
@jbpros all done. I've left it as two commits since it's easier to diff that way. Let me know if you'd like me to squash it. |
Hi @jbpros, Just checking in to see if there's anything I can do to assist further here. |
Awesome! Can we get a merge for PR: #291 please :) Thank you @chrismilleruk and the rest! |
Closed by 4673a59. |
I'm with @mattwyne. Scenario Outlines are great. They allow you to separate the business logic of the test from the individual equivalence partition values, and it's easier for people who didn't write the scenarios to edit the data values later on. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello,
I would expect to be able to have my scenario outline title have more information by using the examples within the title itself:
Then my scenario titles end up very useful:
Scenario: A passing step is passed
Scenario: A failing step is skipped
This doesn't seem to be working for me. Is this a supported feature? If not, is it something that I could assist in having included? Or, is it not expected to work like this?
The text was updated successfully, but these errors were encountered: