Environment: lettuce-0.2.23-py2.7
on Windows 8
For simple scenario (example from Lettuce documentation) everything works:
@step('I am logged in')
def is_logged_in(step):
step.behave_as("""
Given I go to the home page
And I click the login button
And I fill in username:{user} password:{pass}
And I click "Login"
""".format(user='floppy', pass='banana'))
But I don't know how to pass Scenario Outline
with multiply examples like
Given cat with name "<cat_name>"
Examples:
|cat_name|
|filemon |
|tomcat |
Pasting it in parent scenario:
@step('I have bunch of cats')
def bunch_of_cats(step):
step.behave_as("""
Given cat with name "<cat_name>"
Examples:
|cat_name|
|filemon |
|tomcat |
""".format()
StackTrace:
Traceback (most recent call last):
File "build\bdist.win-amd64\egg\lettuce\core.py", line 144, in __call__
ret = self.function(self.step, *args, **kw)
File "\\features\steps\manager_steps.py", line 590, in magic
""".format())
File "build\bdist.win-amd64\egg\lettuce\core.py", line 408, in behave_as
assert not steps_undefined, "Undefined step: %s" % steps_undefined[0].sentence
AssertionError: Undefined step: Examples:
Looks like I need to mess with lettuce-0.2.23-py2.7.egg!\lettuce\core.py
where behave_as
method is implemented to recognise outlines.
Other solution is to implement for loop
for step with examples
as a collection.
Any advice?