| 1 |
Feature: Use a step library |
| 2 |
|
| 3 |
As a tester |
| 4 |
I want to use steps from one or more step libraries |
| 5 |
To simplify the reuse of problem domain specific steps in multiple projects. |
| 6 |
|
| 7 |
|
| 8 |
Scenario: Use a simple step library |
| 9 |
Given a new working directory |
| 10 |
And an empty file named "step_library1/__init__.py" |
| 11 |
And a file named "step_library1/alice_steps.py" with: |
| 12 |
""" |
| 13 |
from behave import step |
| 14 |
|
| 15 |
@step('I meet Alice') |
| 16 |
def step_meet_alice(context): |
| 17 |
pass |
| 18 |
""" |
| 19 |
And a file named "step_library1/bob_steps.py" with: |
| 20 |
""" |
| 21 |
from behave import step |
| 22 |
|
| 23 |
@step('I meet Bob') |
| 24 |
def step_meet_bob(context): |
| 25 |
pass |
| 26 |
""" |
| 27 |
And a file named "features/steps/use_step_library.py" with: |
| 28 |
""" |
| 29 |
from step_library1 import alice_steps, bob_steps |
| 30 |
""" |
| 31 |
And a file named "features/example_use_step_library.feature" with: |
| 32 |
""" |
| 33 |
Feature: |
| 34 |
Scenario: |
| 35 |
Given I meet Alice |
| 36 |
And I meet Bob |
| 37 |
""" |
| 38 |
When I run "behave -f plain features/example_use_step_library.feature" |
| 39 |
Then it should pass with: |
| 40 |
""" |
| 41 |
1 feature passed, 0 failed, 0 skipped |
| 42 |
1 scenario passed, 0 failed, 0 skipped |
| 43 |
2 steps passed, 0 failed, 0 skipped, 0 undefined |
| 44 |
""" |