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

Tagging examples/scenarios within a scenario outline does not work. #54

Closed
kitofr opened this issue May 19, 2011 · 9 comments
Closed

Tagging examples/scenarios within a scenario outline does not work. #54

kitofr opened this issue May 19, 2011 · 9 comments

Comments

@kitofr
Copy link

kitofr commented May 19, 2011

Original Lighthouse Ticket 693

It's not (to my knowledge) possible to tag examples/scenarios within a scenario outline.

Scenario Outline: Something useful
 Given I have <a> 
 When I add <b>
 Then I should have <c>

 Examples: Implemented things 
  | a | b | c | 
  | 0 | 0 | 0 |

 @pending 
 Examples: Not yet implemented things 
  | a | b | c | 
  | 1 | 2 | 3 |
@aslakhellesoy
Copy link
Contributor

Tagging Examples/Scenario/Scenario Outline is indeed possible. Please explain what you expected to happen and what happened.

@aslakhellesoy
Copy link
Contributor

I'm closing this, as I don't understand the bug report and the reporter hasn't clarified.

@kitofr
Copy link
Author

kitofr commented Jun 7, 2011

Sorry for the late answer... been occupied.

ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]

gem list cucumber

*** LOCAL GEMS ***
cucumber (0.4.0)

I've created a folder structure like this:

issue54
\features
\features\issue54.feature

And the issue54.feature file contains the example above.

Running cucumber yields:

features/issue54.feature:11:2: Parse error, expected one of "\n", "\r", "@", "Scenario", "Scenario Outline". (Cucumber::Parser::SyntaxError)
C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/../lib/cucumber/parser/treetop_ext.rb:30:in parse_or_fail' C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/../lib/cucumber/parser/natural_language.rb:43:inparse'
C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/../lib/cucumber/feature_file.rb:27:in parse' C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/../lib/cucumber/step_mother.rb:62:inload_plain_text_features'
C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/../lib/cucumber/step_mother.rb:60:in each' C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/../lib/cucumber/step_mother.rb:60:inload_plain_text_features'
C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/../lib/cucumber/cli/main.rb:48:in execute!' C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/../lib/cucumber/cli/main.rb:24:inexecute'
C:/Ruby187/lib/ruby/gems/1.8/gems/cucumber-0.4.0/bin/cucumber:9
C:/Ruby187/bin/cucumber:19:in `load'
C:/Ruby187/bin/cucumber:19

I was expecting the @pending examples to not be run.

@aslakhellesoy
Copy link
Contributor

You have a parse error in your feature. Can we see it please? (See the Github Flavored Markdown docs about how to include preformatted text).

You are running an an ancient cucumber version (0.4.0). Please upgrade to the latest.

And why did you expect @pending to cause an example not to be run?

@kitofr
Copy link
Author

kitofr commented Jun 7, 2011

Indeed I know that we are using an ancient version. Might be feasible to update; can't guarantee that though, but if it's fixed in a later version all is good.

Scenario Outline: Something useful
 Given I have <a> 
 When I add <b>
 Then I should have <c>

 Examples: Implemented things 
  | a | b | c | 
  | 0 | 0 | 0 |

 @pending 
 Examples: Not yet implemented things 
  | a | b | c | 
  | 1 | 2 | 3 |

@pending to me means "not done"; so; I would expect the same behavior of a pending example as a pending scenario.
Thus something that will be parsed and "tested" but would not fail or give errors (unless fully implemented as in rspec)

@aslakhellesoy
Copy link
Contributor

The ability to put tags on Examples were added in a later version than the one you are using - don't remember which one.
There is no built-in logic that assigns any special meaning to a @pending tag. However, you can exclude certain features/scenarios/examples from running with --tags ~@pending - see https://github.com/cucumber/cucumber/wiki/Tags

@kitofr
Copy link
Author

kitofr commented Jun 7, 2011

Yep, sounds fair.

If added as u say in a later version, just go ahead and close this issue. I'll try to update.

Thanks,
K

@brianpilati
Copy link

I am attempting to use @tags on the examples of a Scenario Outline.

@login
Feature: Login

Scenario Outline: I will login
    Given I login
    Then I click the '<menuName>' menu
    And I logout

@login
Examples:
| menuName      |   
| Splash      |   

@permutations
Examples:
| menuName      |   
| Home       |   

When I set --tags @login both Splash and Home are executed. Any thoughts on what I am doing wrong? My expectation is that only the @login Examples will be run.

@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

No branches or pull requests

3 participants