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

Tag outline scenarios - it runs only one scenario #195

Closed
akania opened this issue Jun 15, 2014 · 9 comments
Closed

Tag outline scenarios - it runs only one scenario #195

akania opened this issue Jun 15, 2014 · 9 comments

Comments

@akania
Copy link
Contributor

akania commented Jun 15, 2014

Given a Feature with scenario:

Feature: test
    @sometag
    Scenario Outline: Scenario outline - run this scenario with different examples
                      To run one scenario with different set of values use scenario outlines

        Given There is initial <value>
        When I subsctract <subsctractValue>
        Then I should have <resultValue>

    Examples:
    | value | subsctractValue | resultValue |
    |  12   |  5              |  7          |
    |  20   |  5              |  15         |

And step definition

var testSteps = function() {
  var Given  = When = Then = this.defineStep;


  Given(/^There is initial (\d+)$/, function(value, callback) {
      this.value = value;
      callback();
  });
  When(/^I subsctract (\d+)$/, function(substractValue, callback) {
      this.result = this.value - substractValue;
      callback();
  });
  Then(/^I should have (\d+)$/, function(result, callback) {
      if (parseInt(result) === this.result) {
          callback();
      } else {
          callback.fail();    
      }
  });
};
module.exports = testSteps;

When i run 'cucumber-js --tags @SomeTag'

Scenario is executed only once with first row of examples

cucumber.js --tags @sometag
....

1 scenario (1 passed)
4 steps (4 passed)

Expected - scenario should be executed for all examples

@akania
Copy link
Contributor Author

akania commented Jun 15, 2014

  • it doesn't matter where i put my tag - over scenario outline or over examples

@akania
Copy link
Contributor Author

akania commented Jun 15, 2014

So it looks like tags are removed here

revealTags: function revealTags() {
      var revealedTags = stashedTags;
      stashedTags      = []; // <- empty array

I'm trying to understand logic behind this, commenting this line helps but all scenarios inherit all tags then..

akania added a commit to akania/cucumber-js that referenced this issue Jun 15, 2014
akania added a commit to akania/cucumber-js that referenced this issue Jun 17, 2014
@akania
Copy link
Contributor Author

akania commented Jun 17, 2014

pull request in #197

@xjchavezx
Copy link

I run into a similar issue, but in my case, only the last row on the table gets run. Any feedback of how to approach this would be great

@charlierudolph
Copy link
Member

What version of cucumber-js are you running? This feature encompasses the current behavior and was added in 0.9.1.

@xjchavezx
Copy link

I'm using cucumberjs version: 0.9.2 with nightwatchjs and the cucumber plugin version - 0.6.7. Not sure if the latest help.

Table looks like this:
Examples:
| extension |
| MLB |
| NASCAR |
| SOCCER |
| NBA |

and the step that uses it:
When I click on link ""

I'm adding additional info just in case it helps.

@charlierudolph
Copy link
Member

Based on the cucumber plugin changelog scenario outlines weren't supported until 1.2.0.

@xjchavezx
Copy link

Yeah, it works now, after updating to a newer version. Apologies I should have checked the changelog.

@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