You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Kind of. There is no obvious way to reuse steps from an import. Specifically, I need a straightforward approach to specify at which level these reused steps should be applied. Without this, the process of integrating shared steps across different tests becomes unclear and cumbersome.
Describe the solution you'd like
My current solution, is very nasty, needs a sanity check. Ideally, I'd like a clean, well-structured method that allows me to define and reuse these steps at various levels within my tests, ensuring a more maintainable and understandable codebase.
Describe alternatives you've considered
I’ve experimented with multiple approaches in the codebase, but each attempt has only deepened my confusion. Nothing so far has provided a clear, reliable pattern for managing and reusing these steps effectively.
Additional context
NA
The overarching goal of my project is to establish predefined, shareable test steps that handle mundane operations—such as setting up data, calling a URL, and then verifying data—in a highly explicit and readable manner. This would simplify common testing patterns and promote consistency across projects. For example:
setup data
call url
check data
Rinse and repeat.
The text was updated successfully, but these errors were encountered:
what about defining your steps in tests/steps.py, and do from tests.steps import * in the modules you need them?
You can even exploit the pytest fixture definition hierarchy, since functions decorated with @given / @when / @then are actually fixtures under the hood.
For example, you can do from tests.steps.global_steps import * in your main tests/conftest.py, and in child packages of your test suite you can then do more granular imports. E.g. in tests/foo/conftest.py you can do from tests.steps.foo_specific_steps import *
Is your feature request related to a problem? Please describe.
Kind of. There is no obvious way to reuse steps from an import. Specifically, I need a straightforward approach to specify at which level these reused steps should be applied. Without this, the process of integrating shared steps across different tests becomes unclear and cumbersome.
Describe the solution you'd like
My current solution, is very nasty, needs a sanity check. Ideally, I'd like a clean, well-structured method that allows me to define and reuse these steps at various levels within my tests, ensuring a more maintainable and understandable codebase.
Describe alternatives you've considered
I’ve experimented with multiple approaches in the codebase, but each attempt has only deepened my confusion. Nothing so far has provided a clear, reliable pattern for managing and reusing these steps effectively.
Additional context
NA
The overarching goal of my project is to establish predefined, shareable test steps that handle mundane operations—such as setting up data, calling a URL, and then verifying data—in a highly explicit and readable manner. This would simplify common testing patterns and promote consistency across projects. For example:
Rinse and repeat.
The text was updated successfully, but these errors were encountered: