我需要打印步骤和场景以了解当前正在执行的场景和步骤。目前,打印 3-4 个步骤的输出,并且在场景完成后批量打印步骤。这使得很难准确地理解一个步骤在哪里结束而其他步骤在哪里开始。
也许一个注释/选项可以在它开始之前与一个水平标记一起打印步进语言(即在When/Then等工作之后的文本)会很棒。
例子:
1)电流:
INFO: Doing a
INFO: Doing b
INFO: Doing c
INFO: Doing x
INFO: Doing y
Scenario: Do several things
Given a,b,c things
And x,y things
2) 期望:
Scenario: Do several things
Given a,b,c things
INFO: Doing a
INFO: Doing b
INFO: Doing c
Scenario: Do several things
And x,y things
INFO: Doing x
INFO: Doing y
// Perhaps a summary in the end is fine (as happening currently)
Scenario: Do several things
Given a,b,c things
And x,y things
几年前有人问过这个问题:http: //grokbase.com/t/gg/cukes/144anjrgjf/cucumber-print-scenario-and-step-before-it-is-executed-on-the-console
但我期待这些年来会看到一些图书馆供应。