Search code examples
node.jstagscucumbergherkin

run cucumber multiple tags in node.js


I have created one feature with three scenarios, each scenario has a tag. Feature: Three scenarios

@Scenario1 Scenario ... Given .... When ... Then ...

@Scenario2 Scenario ... Given .... When ... Then ...

@Scenario3 Scenario ... Given .... When ... Then ...

When I run just with a tag, it is working. command contains: ... --tags @Scenario1

When I tried with two tags, it is not working. The following commands I tried:

  1. ... --tags={"@Scenario1","@Scenario2"}
  2. ... --tags={'@Scenario1','@Scenario2'}
  3. ... --tags={@Scenario1,@Scenario2}
  4. ... --tags={"@Scenario1,@Scenario2"}
  5. ... --tags={"@Scenario1 and @Scenario2"}
  6. ... --tags "@Scenario1 and @Scenario2"
  7. ... --tags @Scenario1 --tags @Scenario2"

Solution

  • Try --tags "@Scenario1 or @Scenario2". See Tag Expressions for details.

    You can also run scenarios by line: cucumber features/hello.feature:34:48