0

I am tyring to implement funtionality before a step and after a step in python

Scenario: Addition
        Given Calculator app is run
        When I input "2+3" to calculator
        Then I get result "5"

i wish to execute a funtionality before executing second step. How can i proceed ?

satishsrip
  • 125
  • 3
  • 12

1 Answers1

1

The environment.py file can be used for this:

features/environment.py

def before_step(context, step):
    if <some logic to determine which step this is>:
        do_something_before_step()

def after_step(context, step):
    if <some logic to determine which step this is>:
        do_something_after_step()
Levi Noecker
  • 3,142
  • 1
  • 15
  • 30
  • From the above scenario as i posted how can i implement the logic to skip the second step – satishsrip Jun 27 '20 at 22:35
  • some helpful info: https://stackoverflow.com/questions/26504047/skip-a-behave-step-in-the-step-implementation I think you can skip right now scenario on condition – automationleg Aug 05 '20 at 16:48