在我的黄瓜应用程序中有以下步骤定义:@Then("Client {string} just但是,如果我使用步骤Then Client "PC1" just received 1 "RequestReject运行一个场景,则会得到以下错误:
'com.me.ed.testtool.StepDef.clientJustReceivedRequestR
在Cucumber中,您可以编写Then表达式及其步骤定义来验证结果。问题是我不想写两个不同的步骤定义来检查结果。一个示例如下: Then the transaction is successful 和 Then the transaction is not successful 我怎么才能避免这个问题呢?我发现在Ruby中,您可以通过使用捕获可选组来合并步骤定义,如[here]所述。这就是: Then /