Serenity передает неправильное определение параметрам

#java #functional-testing #jbehave #serenity-bdd

#java #функциональное тестирование #jbehave #serenity-bdd

Вопрос:

Я считаю, что проблема в serenity. Проблема в том, что в моем файле истории у меня есть определения, которые работали до недавнего времени, но теперь, когда serenity анализирует мой файл истории, определение, которое он проверяет, неверно.

Файл истории

 Given the following comment information to be added:
| comment-Id | comment-type | Text      |
| 121        | New          | longText1 |
  

Определение

 @Given("the following comment information to be added: $commentsTable")
public void givenTheCommentInformation(final ExamplesTable commentsTable) {
       steps.givenCommentInformation(commentsTable);
}
  

Теперь вот в чем проблема

 [pool-1-thread-1] ERROR net.thucydides.core.steps.ConsoleLoggingListener - TEST FAILED AT STEP Given the following comment information to be added: | comment-Id | comment-type | Text | | 121 | New | longText1 |
[pool-1-thread-1] ERROR net.thucydides.core.steps.ConsoleLoggingListener - 

org.jbehave.core.io.StoryResourceNotFound: Story path 'to be added:
| comment-Id | comment-type | Text      |
| 121        | New          | longText1 |' not found by class loader sun.misc.Launcher$AppClassLoader@135fbaa4
    at org.jbehave.core.io.LoadFromClasspath.resourceAsStream(LoadFromClasspath.java:82)
    at org.jbehave.core.io.LoadFromClasspath.loadResourceAsText(LoadFromClasspath.java:66)
    at org.jbehave.core.model.ExamplesTableFactory.createExamplesTable(ExamplesTableFactory.java:76)
    at org.jbehave.core.steps.ParameterConverters$ExamplesTableConverter.convertValue(ParameterConverters.java:769)
    at org.jbehave.core.steps.ParameterConverters$ExamplesTableConverter.convertValue(ParameterConverters.java:759)
    at org.jbehave.core.steps.ParameterConverters.convert(ParameterConverters.java:227)
    at org.jbehave.core.steps.StepCreator.convertParameterValues(StepCreator.java:421)
    at org.jbehave.core.steps.StepCreator.access$1400(StepCreator.java:48)
    at org.jbehave.core.steps.StepCreator$ParametrisedStep.parametriseStep(StepCreator.java:844)
    at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:786)
    at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:349)
  

Хорошо, теперь, если вы посмотрите на это. Вы можете видеть, что путь неполный, он начинается с 'to be added:' У меня никогда не было этой проблемы раньше, любая помощь очень ценится.

 org.jbehave.core.io.StoryResourceNotFound: Story path 'to be added:
    | comment-Id | comment-type | Text      |
    | 121        | New          | longText1 |' not found by class loader sun.misc.Launcher$AppClassLoader@135fbaa4
  

Комментарии:

1. У вас есть еще один шаг, например, @Given("the following comment information $someVariable") ?

2. @VaL Нет, все мои шаги имеют разные строки. Я полагаю, что это указывает неправильный путь, потому что, когда я получал эту ошибку раньше, я думал, что она должна показывать всю строку.

3. Ошибка в сообщении от Дженкинса, я не могу воспроизвести ошибку локально.

4. как выполнить тесты на Jenkins?

5. @VaL Ты был прав. Я, наконец, нашел шаг, который я использовал для поиска в path, и я был не в той папке. Вы запускаете тест Дженкинса с помощью скрипта Дженкинса, а я использую maven.