Gherkin + Behat 场景大纲抛出了 Behat\Gherkin\Exception\ParserException

9

我正在尝试运行注册示例,但遇到了问题。

Scenario: New user registration; poor password
  Given I am on "/register"
  When I fill in "username" with "admin"
  And I fill in "password1" with "<pw>"
  And I fill in "password2" with "<pw>"
  And I press "Login"
  Then I should be on "/register"
  And I should see an "pwError" element

  Examples:
    |  pw   |
    |  12   |
    |  20   |

然后我收到了以下错误信息:

[Behat\Gherkin\Exception\ParserException] 预期为注释或场景或大纲或步骤标记,但得到的是举例

我做错了什么?我在behat文档或其他地方找不到任何帮助。

1个回答

18

使用示例时,必须使用“Scenario Outline”而不是“Scenario”。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接