File: step.use_step_library.feature

package info (click to toggle)
behave 1.2.6-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,160 kB
  • sloc: python: 19,857; makefile: 137; sh: 18
file content (44 lines) | stat: -rw-r--r-- 1,274 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
Feature: Use a step library

  As a tester
  I want to use steps from one or more step libraries
  To simplify the reuse of problem domain specific steps in multiple projects.


  Scenario: Use a simple step library
    Given a new working directory
    And an empty file named "step_library1/__init__.py"
    And a file named "step_library1/alice_steps.py" with:
      """
      from behave import step

      @step('I meet Alice')
      def step_meet_alice(context):
          pass
      """
    And a file named "step_library1/bob_steps.py" with:
      """
      from behave import step

      @step('I meet Bob')
      def step_meet_bob(context):
          pass
      """
    And a file named "features/steps/use_step_library.py" with:
      """
      from step_library1 import alice_steps, bob_steps
      """
    And a file named "features/example_use_step_library.feature" with:
      """
      Feature:
        Scenario:
          Given I meet Alice
          And   I meet Bob
      """
    When I run "behave -f plain features/example_use_step_library.feature"
    Then it should pass with:
        """
        1 feature passed, 0 failed, 0 skipped
        1 scenario passed, 0 failed, 0 skipped
        2 steps passed, 0 failed, 0 skipped, 0 undefined
        """