For a step in Behave, is there some variable I can use to log the current step text? e.g.
When I go running
@when(u'I go running')
def step_impl(context):
log(f'Behave().currentStepText}')
...
For a step in Behave, is there some variable I can use to log the current step text? e.g.
When I go running
@when(u'I go running')
def step_impl(context):
log(f'Behave().currentStepText}')
...
Not directly, but you can use before_step in the environment.py file to save the step.name into the context and then use that in the step implementation.
Run the example below using 'behave --no-capture' so that the prints in the steps implementation show up on stdout.
environment.py:
feature/feature.py:
steps/step.py: