Commit bb2539dd by enewton

Test to demonstrate problem with outline scenarios

parent 8d1952f3
Feature: Test undefined steps are displayed on console
Scenario: Scenario with undefined step
Given this test step passes
When this test step is undefined
Scenario Outline: Outline scenario with general undefined step
Given this test step passes
When this test step is undefined
Then <in> squared is <out>
Examples:
| in | out |
| 1 | 1 |
| 2 | 4 |
from lettuce import step, world
@step(u'this test step passes')
def this_test_step_passes(step):
assert True
@step(u'(.*) squared is (.*)')
def val1_squared_is_val2(step, val1, val2):
pass
...@@ -1367,3 +1367,44 @@ def test_feature_missing_scenarios(): ...@@ -1367,3 +1367,44 @@ def test_feature_missing_scenarios():
"Features must have scenarios.\nPlease refer to the documentation " "Features must have scenarios.\nPlease refer to the documentation "
"available at http://lettuce.it for more information.\n" % filename "available at http://lettuce.it for more information.\n" % filename
) )
@with_setup(prepare_stdout)
def test_output_with_undefined_steps_colorful():
"With colored output, an undefined step should be printed in sequence."
runner = Runner(feature_name('undefined_steps'), verbosity=4)
runner.run()
assert_stdout_lines_with_traceback(
'\n'
'\x1b[1;37mFeature: Test undefined steps are displayed on console \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.feature:1\x1b[0m\n'
'\n'
'\x1b[1;37m Scenario: Scenario with undefined step \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.feature:3\x1b[0m\n'
'\x1b[1;30m Given this test step passes \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.py:4\x1b[0m\n'
'\x1b[A\x1b[1;32m Given this test step passes \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.py:4\x1b[0m\n'
'\x1b[0;33m When this test step is undefined \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.feature:5\x1b[0m\n'
'\n'
'\x1b[1;37m Scenario Outline: Outline scenario with general undefined step \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.feature:7\x1b[0m\n'
'\x1b[0;36m Given this test step passes \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.py:4\x1b[0m\n'
'\x1b[0;33m When this test step is undefined \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.feature:5\x1b[0m\n'
'\x1b[0;36m Then <in> squared is <out> \x1b[1;30m# tests/functional/output_features/undefined_steps/undefined_steps.py:8\x1b[0m\n'
'\n'
'\x1b[1;37m Examples:\x1b[0m\n'
'\x1b[0;36m \x1b[1;37m |\x1b[0;36m in\x1b[1;37m |\x1b[0;36m out\x1b[1;37m |\x1b[0;36m\x1b[0m\n'
'\x1b[1;32m \x1b[1;37m |\x1b[1;32m 1 \x1b[1;37m |\x1b[1;32m 1 \x1b[1;37m |\x1b[1;32m\x1b[0m\n'
'\x1b[1;32m \x1b[1;37m |\x1b[1;32m 2 \x1b[1;37m |\x1b[1;32m 4 \x1b[1;37m |\x1b[1;32m\x1b[0m\n'
'\n'
'\x1b[1;37m1 feature (\x1b[0;31m0 passed\x1b[1;37m)\x1b[0m\n'
'\x1b[1;37m3 scenarios (\x1b[0;31m0 passed\x1b[1;37m)\x1b[0m\n'
'\x1b[1;37m8 steps (\x1b[0;36m2 skipped\x1b[1;37m, \x1b[0;33m3 undefined\x1b[1;37m, \x1b[1;32m3 passed\x1b[1;37m)\x1b[0m\n'
'\n'
'\x1b[0;33mYou can implement step definitions for undefined steps with these snippets:\n'
'\n'
'# -*- coding: utf-8 -*-\n'
'from lettuce import step\n'
'\n'
"@step(u'When this test step is undefined')\n"
'def when_this_test_step_is_undefined(step):\n'
" assert False, 'This step must be implemented'\x1b[0m\n"
)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment