Skip to content
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 Outlines: Replace tokens in the names of the generated "Example Scenario"s #580

Merged
merged 1 commit into from
Sep 3, 2013

Conversation

jamiewastin
Copy link
Contributor

My changes are best illustrated with the following example scenario:

Scenario Outline: Time offset check for <LOCATION_NAME>
 Given my local country is <LOCATION_NAME>
 When I compare the time difference to GMT
 Then the time offset should be <OFFSET>

 Examples: 
  | LOCATION_NAME | OFFSET |
  | London        | 1      |
  | New York      | 4      |
  | San Fran      | 8      |

I was hoping in the generated report would have the LOCATION_NAME token substituted for the value of the example being run in the scenario outline name. However this is not happening - and each scenario outline has the name verbatim from the above: Scenario Outline: Time offset check for <LOCATION_NAME>.

This change simply runs the scenario name through CucumberScenarioOutline.replaceTokens(...) method to replace the tokens with the relevant values for each "Scenario Example" that is generated.

Fixes #510.

@aslakhellesoy
Copy link
Contributor

Please see formatting rules in CONTRIBUTING.md - 4 space indent.

@jamiewastin
Copy link
Contributor Author

@aslakhellesoy - My apologies, consider them corrected!

@jamiewastin
Copy link
Contributor Author

Side note, I've realised that there is an open issue on this. So the implementation of this should close-out #510

@@ -18,6 +17,8 @@
import java.util.List;
import java.util.Set;

import cucumber.runtime.Runtime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why move the import?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest commit.

@jamiewastin
Copy link
Contributor Author

OK guys, I've fixed all the indentation and imports - I've rebased and re-pushed the changes. So hopefully this pull request is now a single commit that we're all happy with? :-)

@aslakhellesoy
Copy link
Contributor

I'm usually ok with rearranged imports - I don't want us to appear too strict :-)

Great patch and thanks for finding the related issue as well! @brasmusson do you want to merge this one in?

@brasmusson
Copy link
Contributor

Yes, I can take care of the merging of this one.

My comment on the import was maybe a little picky. The big risk I can see is that the "helpfulness" of our different IDE's makes the import to be rearranged to different standards every other commit (static imports first, static imports last, ...)

brasmusson added a commit that referenced this pull request Sep 3, 2013
@brasmusson brasmusson merged commit 12e0223 into cucumber:master Sep 3, 2013
@lock
Copy link

lock bot commented Oct 25, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON report : Handle placeholder in scenario outline title
3 participants