0

我很想在python中的一步之前和之后实现功能性

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

我希望在执行第二步之前执行一个功能。我该如何进行?

4

1 回答 1

1

environment.py文件可用于:

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()
于 2020-06-26T15:13:16.593 回答