TestNG Assertion не работает со строкой документов Cucumber / Gherkin? - PullRequest
0 голосов
/ 19 февраля 2019

В настоящее время я пытаюсь использовать строки документации Cucumber, дополнительную информацию можно получить здесь: https://docs.cucumber.io/gherkin/reference/#gherkin-dialects однако мой код, похоже, не работает, используя утверждение TestNG для сравнения файла функции String со строкой, которая находится в моем файле шага,есть идеи?

Мой файл функций:

  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.
    """

Метод My Step:

@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.]
...