Debian Codegraph @

features/runner.select_files_by_regexp.example.feature

raw
1 Feature: Select feature files by using regular expressions (self-test)
2
3 Use behave self-tests to ensure that --incude/--exclude options work.
4 RELATED: runner.select_files_by_regexp.feature
5
6 @setup
7 Scenario: Feature Setup
8 Given a new working directory
9 And an empty file named "features/steps/steps.py"
10 And a file named "features/alice.feature" with:
11 """
12 Feature: Alice
13 Scenario: A1
14 """
15 And a file named "features/barbi.feature" with:
16 """
17 Feature: Barbi
18 Scenario: B1
19 """
20 And a file named "features/bob.feature" with:
21 """
22 Feature: Bob
23 Scenario: B2
24 """
25
26
27 Scenario: Include only feature files
28
29 Select the following feature files: barbi.feature, bob.feature
30
31 When I run "behave --include='features/b.*' -f plain features/"
32 Then it should pass with:
33 """
34 2 features passed, 0 failed, 0 skipped
35 """
36 And the command output should contain:
37 """
38 Feature: Barbi
39 Scenario: B1
40
41 Feature: Bob
42 Scenario: B2
43 """
44
45 Scenario: Exclude only feature files
46
47 Select the following feature files: alice.feature
48
49 When I run "behave --exclude='features/b.*' -f plain features/"
50 Then it should pass with:
51 """
52 1 feature passed, 0 failed, 0 skipped
53 """
54 And the command output should contain:
55 """
56 Feature: Alice
57 """
58
59 Scenario: Include and exclude feature files
60
61 Select the following feature files: alice.feature
62
63 When I run "behave --include='features/.*a.*\.feature' --exclude='.*/barbi.*' -f plain features/"
64 Then it should pass with:
65 """
66 1 feature passed, 0 failed, 0 skipped
67 """
68 And the command output should contain:
69 """
70 Feature: Alice
71 """