Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Tests/
- --BehaveTest1/
- ----BehaveTest1.feature
- ----steps/
- ------test_steps.py
- --BehaveTest2/
- ----BehaveTest2.feature
- ----steps/
- ------test_steps.py
- import sys, os
- sys.path.append('../common')
- import common
- Tests/
- ├── BehaveTest1
- │ ├── BehaveTest1.feature
- │ └── steps
- │ └── test_steps.py
- ├── BehaveTest2
- │ ├── BehaveTest2.feature
- │ └── steps
- │ └── test_steps.py
- ├── common.py
- ├── __init__.py
- import Tests.common
- from behave import when, then
- @when("foo")
- def foo(context):
- pass
- @then("bar")
- def bar(context):
- pass
- $ behave Tests/BehaveTest*
- Feature: BehaveTest1 # Tests/BehaveTest1/BehaveTest1.feature:1
- Scenario: foo # Tests/BehaveTest1/BehaveTest1.feature:3
- When foo # Tests/common.py:3 0.000s
- Then bar # Tests/common.py:7 0.000s
- Feature: BehaveTest2 # Tests/BehaveTest2/BehaveTest2.feature:1
- Scenario: foo # Tests/BehaveTest2/BehaveTest2.feature:3
- When foo # Tests/common.py:3 0.000s
- Then bar # Tests/common.py:7 0.000s
- 2 features passed, 0 failed, 0 skipped
- 2 scenarios passed, 0 failed, 0 skipped
- 4 steps passed, 0 failed, 0 skipped, 0 undefined
- Took 0m0.000s
- :$ behave Tests/BehaveTest1/BehaveTest1.feature
- import Tests.common
- DIRECTORY STRUCTURE:
- +-- features/
- +-- steps/ (optional, common steps)
- +-- alice.features/
- | +-- steps/ (specific steps for alice sub features, can use common steps)
- | +-- *.feature
- +-- bob.features/
- +-- steps/
- +-- *.feature
- +-- environment.py
- features/test.feature
- test_steps/
- test_steps/classes
- test_environment.py
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement