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 71
|
Feature: Select feature files by using regular expressions (self-test)
Use behave self-tests to ensure that --incude/--exclude options work.
RELATED: runner.select_files_by_regexp.feature
@setup
Scenario: Feature Setup
Given a new working directory
And an empty file named "features/steps/steps.py"
And a file named "features/alice.feature" with:
"""
Feature: Alice
Scenario: A1
"""
And a file named "features/barbi.feature" with:
"""
Feature: Barbi
Scenario: B1
"""
And a file named "features/bob.feature" with:
"""
Feature: Bob
Scenario: B2
"""
Scenario: Include only feature files
Select the following feature files: barbi.feature, bob.feature
When I run "behave --include='features/b.*' -f plain features/"
Then it should pass with:
"""
2 features passed, 0 failed, 0 skipped
"""
And the command output should contain:
"""
Feature: Barbi
Scenario: B1
Feature: Bob
Scenario: B2
"""
Scenario: Exclude only feature files
Select the following feature files: alice.feature
When I run "behave --exclude='features/b.*' -f plain features/"
Then it should pass with:
"""
1 feature passed, 0 failed, 0 skipped
"""
And the command output should contain:
"""
Feature: Alice
"""
Scenario: Include and exclude feature files
Select the following feature files: alice.feature
When I run "behave --include='features/.*a.*\.feature' --exclude='.*/barbi.*' -f plain features/"
Then it should pass with:
"""
1 feature passed, 0 failed, 0 skipped
"""
And the command output should contain:
"""
Feature: Alice
"""
|