I am new to the Cucumber framework. I am trying to make Cucumber work with Python. I have written the feature file and want to know how to write the step definitions in Pyth
Check out behave, behaviour-driven development library, Python style.
Behavior-driven development (or BDD) is an agile software development technique that encourages collaboration between developers, QA and non-technical or business participants in a software project. We have a page further describing this philosophy.
behave uses tests written in a natural language style, backed up by Python code.
It doesn't use Cucumber, but you can reuse .feature
files because they use the same Gherkin language.
Sample behave's step definition:
from behave import *
@given('we have behave installed')
def step_impl(context):
pass
@when('we implement a test')
def step_impl(context):
assert True is not False
@then('behave will test it for us!')
def step_impl(context):
assert context.failed is False