radish-bdd / radish

Behavior Driven Development tooling for Python. The root from red to green.
https://radish-bdd.github.io
MIT License
182 stars 49 forks source link

[ANSWERED] Question: Knowing actual Step #402

Closed dschiller closed 4 years ago

dschiller commented 4 years ago

Is there a way to find out the Name of the actual Step is running ?

BDD File:

...
Do some fancy Step
...

Steps.py File:

...
def saveScreenshot():
        Scenario.driver.save_screenshot('<Name of the Step here>.png')  # Something like Scenario.actual_step_name()
...
@step('Do some fancy Step')
def stepImpl(step):
    saveScreenshot()
...
dschiller commented 4 years ago

Found it. It is step.expanded_sentence.