Feature如何解决参数数量不匹配

问题描述: Feature 写了两个参数,匹配到Steps.Java,  文件只写了两个参数,但是两个参数都加了$ 符号。 而$ 又是结束的意思。

1一:Feature  用例

二:Steps.Java 文件 写的是: @Then("^I add repeats leave code (.+)$ record of details$")

三: 最后运行导致:参数数量不匹配,报: with pattern [^I add repeats leave code NPL record of details$] is declared with 2 parameters. However, the gherkin step has 1 arguments 错误提示信息

四:解决方法:

        需要将 @Then("^I add repeats leave code (.+)$ record of details$") 修改为 @Then("^I add repeats leave code (.+) record of details$")

原文地址:https://www.cnblogs.com/Shanghai-vame/p/7743083.html