Cucumber-js: @ignore on Scenario still executes it

Created on 6 Feb 2015  路  29Comments  路  Source: cucumber/cucumber-js

When adding @ignore on a Scenario does not ignore the Scenario, but still executes it.

Most helpful comment

You need to tell Cucumber to ignore scenarios based on your tag, it doesn't know the meaning of your @ignore tag.

Not tested:

cucumberOpts: {
  require: 'cucumber/features/steps/*_steps.js',
  format: 'pretty',
  tags: '~@ignore'
}

See cucumber.js --help for more info.

All 29 comments

@D0rmouse how do you invoke cucumber.js after tagging a scenario with @ignore?

It's integrated in my Grunt build using grunt-protractor-runner, which reads a cucumber.conf.js.

Sorry, I wasn't clear enough. What options are you passing to Cucumber?

cucumberOpts: {
    require: 'cucumber/features/steps/*_steps.js',
    format: 'pretty'
  }

You need to tell Cucumber to ignore scenarios based on your tag, it doesn't know the meaning of your @ignore tag.

Not tested:

cucumberOpts: {
  require: 'cucumber/features/steps/*_steps.js',
  format: 'pretty',
  tags: '~@ignore'
}

See cucumber.js --help for more info.

Right, thank you. The way I read it in the readme, it seemed to should be working out of the box...

Ha, which part of the README?

OMG haha, silly me. That would be the https://github.com/cucumber/cucumber/wiki/Tags :(
Too many tabs opened I guess. Sorry to have bothered you...

No worries!

--tags option doesn't work for me

    cucumber() {
        return gulp.src("*.js", { read: false })
            .pipe(shell("cucumber.js -r ./build/es5/test/cucumber/steps/CommonStepDefinitions.js --tags ~@skip test/cucumber/features"));
    }

also used -t ~@skip shortcut,

cucumber's version: "0.10.2"

@hbakhtiyor can you explain how it is not working for you exactly? What do you expect, what happens instead?

just not skipping the scenarios which i marked @skip

also tried the command via terminal, not success

bash# cucumber.js -r ./build/es5/test/cucumber/steps/CommonStepDefinitions.js --tags ~@skip test/cucumber/features

e.g. entity.feature

Feature: [GET /entities] Get list of entities
  # for success
  @skip
  Scenario: Request for all published entities
    Given collection of entities from entity/entities.json data file
    And request "filter" query param's property "published" set to true
    When I request GET /entities
    Then the response status code is 200
    And the response type is JSON
    And the response matches entity/all-entities-published-only.json

@hbakhtiyor what's your version of cucumber?

cucumber's version: "0.10.2"

before used 0.9.2 version, --tags option didn't work in the version and used the latest version which 0.10.2, also didn't work too

In 0.10, the tag interface changed. Are you using the new interface?

i only use tags on .feature files

Well that is very odd. We don't appear to have any feature tests cases around negated tags, but we are using negated tags in our own tests. Does --tags @skip work for you? (running only the scenarios you would skip)

opposite doesn't work too

@charlierudolph I'm pretty sure we used to have scenarios testing tag exclusion. That must have been lost when we consolidated the test suite. I've just added one.

@hbakhtiyor I can't reproduce the problem. Can you share some code with us?

np, but why is it depends from code (step definition, hook,..)?

@hbakhtiyor I mean it'd be great to share some gulp/cucumber setup that doesn't work as you expect.

~@skip approach isn't working - at least on MacOS.

The same problem I have with [email protected] on ubuntu 16: tags exclusion don't work for me when I run cucumberjs --tags ~@smth, but --tags @smth works fine.

By "don't work" I mean that scenarios with tags different from @smth don't execute.

Why the issue is closed? Will you @jbpros be able to investigate it more?

Why the issue is closed?

@likerRr this issue is closed because the explanation offered by @jbpros 2 years ago was sufficient for @D0rmouse, who closed the issue.

Please create a new ticket if you're facing problems.

Sorry, ok

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jfstephe picture jfstephe  路  4Comments

edgarechm picture edgarechm  路  5Comments

hdorgeval picture hdorgeval  路  3Comments

bmsoko picture bmsoko  路  7Comments

protoman92 picture protoman92  路  3Comments