File: cucumber_cli_outlines.feature

package info (click to toggle)
cucumber 1.3.17-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,296 kB
  • ctags: 1,812
  • sloc: ruby: 13,576; python: 28; sh: 10; makefile: 10; tcl: 3
file content (117 lines) | stat: -rw-r--r-- 4,112 bytes parent folder | download | duplicates (3)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Feature: Cucumber command line
  In order to write better software
  Developers should be able to execute requirements as tests

  Scenario: Run scenario outline with filtering on outline name
    When I run cucumber -q features --name "Test state"
    Then it should fail with
      """
      Feature: Outline Sample

        Scenario Outline: Test state
          Given <state> without a table
          Given <other_state> without a table

          Examples: Rainbow colours
            | state   | other_state |
            | missing | passing     |
            | passing | passing     |
            | failing | passing     |
            FAIL (RuntimeError)
            ./features/step_definitions/sample_steps.rb:2:in `flunker'
            ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
            features/outline_sample.feature:6:in `Given <state> without a table'

          Examples: Only passing
            | state   | other_state |
            | passing | passing     |

      Failing Scenarios:
      cucumber features/outline_sample.feature:5

      4 scenarios (1 failed, 1 undefined, 2 passed)
      8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)

      """

  Scenario: Run scenario outline steps only
    When I run cucumber -q features/outline_sample.feature:7
    Then it should fail with
      """
      Feature: Outline Sample

        Scenario Outline: Test state
          Given <state> without a table
          Given <other_state> without a table

          Examples: Rainbow colours
            | state   | other_state |
            | missing | passing     |
            | passing | passing     |
            | failing | passing     |
            FAIL (RuntimeError)
            ./features/step_definitions/sample_steps.rb:2:in `flunker'
            ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
            features/outline_sample.feature:6:in `Given <state> without a table'

          Examples: Only passing
            | state   | other_state |
            | passing | passing     |

      Failing Scenarios:
      cucumber features/outline_sample.feature:5

      4 scenarios (1 failed, 1 undefined, 2 passed)
      8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)

      """

  Scenario: Run single failing scenario outline table row
    When I run cucumber features/outline_sample.feature:12
    Then it should fail with
      """
      Feature: Outline Sample

        Scenario Outline: Test state          # features/outline_sample.feature:5
          Given <state> without a table       # features/step_definitions/sample_steps.rb:15
          Given <other_state> without a table # features/step_definitions/sample_steps.rb:12

          Examples: Rainbow colours
            | state   | other_state |
            | failing | passing     |
            FAIL (RuntimeError)
            ./features/step_definitions/sample_steps.rb:2:in `flunker'
            ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
            features/outline_sample.feature:6:in `Given <state> without a table'

      Failing Scenarios:
      cucumber features/outline_sample.feature:5 # Scenario: Test state

      1 scenario (1 failed)
      2 steps (1 failed, 1 skipped)

      """

  # There are 10 characters in the progress, but only 8 reported steps. Needs investigation.
  # Looks like we're outputting too many characters.
  Scenario: Run all with progress formatter
    When I run cucumber -q --format progress features/outline_sample.feature
    Then it should fail with
      """
      --U-..F-..

      (::) failed steps (::)

      FAIL (RuntimeError)
      ./features/step_definitions/sample_steps.rb:2:in `flunker'
      ./features/step_definitions/sample_steps.rb:16:in `/^failing without a table$/'
      features/outline_sample.feature:6:in `Given <state> without a table'

      Failing Scenarios:
      cucumber features/outline_sample.feature:5

      5 scenarios (1 failed, 1 undefined, 3 passed)
      8 steps (1 failed, 2 skipped, 1 undefined, 4 passed)

      """