我目前正在尝试使用Cucumber Doc字符串,此处更多信息:https://docs.cucumber.io/gherkin/reference/#gherkin-dialects,但是我的代码似乎无法使用TestNG断言将功能文件字符串与包含在我的步骤文件中的字符串进行比较,想法?
我的功能文件:
Scenario: Test
Given then i should receive an email with the body off:
"""
then i should receive an email with the body off
then i should receive an email with the body off.
"""
我的步进方法:
@Given("^then i should receive an email with the body off:")
public void how_are_your(String arg1) {
Assert.assertEquals(arg1, "then i should receive an email with the body off" + "\nthen i should receive an email with the body off.");
}
断言似乎失败,提供以下异常:
java.lang.AssertionError: expected [then i should receive an email with the body off
then i should receive an email with the body off.] but found [then i should receive an email with the body off
then i should receive an email with the body off.]
并排的异常:
expected [then i should receive an email with the body off
then i should receive an email with the body off.]
found [then i should receive an email with the body off
then i should receive an email with the body off.]