Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 71 lines (61 sloc) 2.88 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
Feature: Tags

Scenario: execute scenarios matching a tag
Given a scenario tagged with "@foo"
And a scenario tagged with "@bar"
When Cucumber executes scenarios tagged with "@foo"
# cucumber --tags @foo
Then only the first scenario is executed

Scenario: execute scenarios not matching a tag
Given a scenario tagged with "@foo"
And a scenario tagged with "@bar"
When Cucumber executes scenarios not tagged with "@bar"
# cucumber --tags ~@bar
Then only the first scenario is executed

Scenario: execute scenarios matching any of several tags (OR)
Given a scenario tagged with "@bar"
And a scenario tagged with "@foo"
And a scenario tagged with "@baz"
When Cucumber executes scenarios tagged with "@foo" or "@bar"
# cucumber --tags @foo,@bar
Then only the first two scenarios are executed

Scenario: execute scenarios matching several tags (AND)
Given a scenario tagged with "@foo" and "@bar"
And a scenario tagged with "@foo"
When Cucumber executes scenarios tagged with both "@foo" and "@bar"
# cucumber --tags @foo --tags @bar
Then only the first scenario is executed

Scenario: execute scenarios not matching any tag (NOT OR NOT)
Given a scenario tagged with "@foo" and "@bar"
And a scenario tagged with "@bar"
And a scenario tagged with "@baz"
And a scenario tagged with "@foo"
When Cucumber executes scenarios not tagged with "@foo" nor "@bar"
# cucumber --tags ~@foo --tags ~@bar
Then only the third scenario is executed

Scenario: exclude scenarios matching two tags (NOT AND NOT)
Given a scenario tagged with "@foo" and "@bar"
And a scenario tagged with "@bar"
And a scenario tagged with "@baz"
And a scenario tagged with "@foo"
When Cucumber executes scenarios not tagged with both "@foo" and "@bar"
# cucumber --tags ~@foo,~@bar
Then only the second, third and fourth scenarios are executed

Scenario: with tag or without other tag
Given a scenario tagged with "@foo" and "@bar"
And a scenario tagged with "@baz"
And a scenario tagged with "@bar"
When Cucumber executes scenarios tagged with "@foo" or without "@bar"
# cucumber --tags @foo,~@bar
Then only the first two scenarios are executed

Scenario: with tag but without two other tags
Given a scenario tagged with "@foo" and "@bar"
And a scenario tagged with "@foo", "@bar" and "@baz"
And a scenario tagged with "@baz"
When Cucumber executes scenarios tagged with "@baz" but not with both "@foo" and "@bar"
# cucumber --tags @baz --tags ~@foo --tags ~@bar
Then only the third scenario is executed

Scenario: execute scenario with tagged feature
Given a feature tagged with "@foo"
And a scenario without any tags
When Cucumber executes scenarios tagged with "@foo"
Then the scenario is executed
Something went wrong with that request. Please try again.