- I am using cucumber to feed scenario and java as a language.
- I need to ignore particular scenario, while running an automation test.
- I have tried with below @ignore syntax, it doesn't work at all.
- It doesn't skip particular scenario, it keeps on executing all the test scenario, which I have feed in the feature file.
Feature File
@ActivateSegment
Feature: Test for Activate segment
Scenario: Login
Given I navigate to M
And I enter user name
And I enter password
And I login to MM
Scenario: Open grid
Given I choose menu
And I choose Segments menu
Scenario: Open segment creation page
Given I click on New button
And I click on Segment button
in cucumber options
in runner class, use the tags as shown below that you don't want to run: tags = {"~@avoid"}
Use tag
~@tag_name
To exclude scenarios with a certain tag
Note I used
~
symbol.UPDATE 1
Sample Scenario
Running Tags
Offical document: https://github.com/cucumber/cucumber/wiki/Tags
Using the
JUnit runner class
and with reference to https://cucumber.io/docs/cucumber/api/#ignoring-a-subset-of-scenariosYou can create your own ignore tag
Then just tag the scenario like so:
*.feature
CucumberHooks.java
From the command line, you can write
put double quote ("") outside and single quote(') inside
I believe the special tag
@wip
already has native support, and can be used without any other code additions.It even has a related command line switch:
-w, --wip Fail if there are any passing scenarios.