Raul_M
Raul_M

Reputation: 301

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"

Upvotes: 2

Views: 7961

Answers (2)

Rohit Totlani
Rohit Totlani

Reputation: 1

try --tags @Scenario1 , @Scenario2

Upvotes: -1

Aslak Hellesøy
Aslak Hellesøy

Reputation: 1191

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

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

Upvotes: 5

Related Questions