0

我的示例表和元过滤器测试不想开始。我正在使用 jbehave-core 4.0.4 和 serenity 1.1.21

我有以下场景(此处简化但也有类似问题)

Meta:
@env any
@run

Scenario: Add new logo by Role (test)
Given I am on soccer home page
When I login as "<login>" with "<password>" password
Examples:
| login                                 | password |
| {{site.executive.username::property}} | {{site.executive.password::property}} |
| {{site.webmaster.username::property}} | {{site.webmaster.password::property}} |

我正在使用以下命令来运行测试

verify -Dmetafilter=+run

我正在使用此“@run”标签在本地计算机上进行测试运行。但是这个命令并没有运行我上面的场景。输出是“成功”,但输出有:

Scenario: Add new logo by Role (test)
Failed to run story stories/club/ClubSetups1.story
java.lang.NullPointerException
    at org.jbehave.core.embedder.PerformableTree$PerformableScenario.perform(PerformableTree.java:876)
    at org.jbehave.core.embedder.PerformableTree$PerformableStory.performScenarios(PerformableTree.java:804)
    at org.jbehave.core.embedder.PerformableTree$PerformableStory.perform(PerformableTree.java:777)
    at org.jbehave.core.embedder.PerformableTree.performCancellable(PerformableTree.java:409)
    at org.jbehave.core.embedder.PerformableTree.perform(PerformableTree.java:380)
    at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:291)
    at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:265)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
12 stories excluded by filter: +run -ignore

奇怪的是,如果我为每一行添加带有“@run”值的“Meta:”列,测试执行得很好。所以我认为元过滤器适用于示例表,即使表没有“Meta:”列,从我的角度来看这是错误的。

可能有人建议解决方案,因为现在我除了添加这个“Meta:”列之外什么都看不到。但这很糟糕,因为我必须复制我拥有的所有参数。

4

1 回答 1

0

看看恢复到以前版本的 jbehave 是否有帮助。4.0.4 似乎有一个错误。请参阅此链接 https://groups.google.com/forum/#!topic/jbehave-dev/7OxwmOXZPVk

于 2016-03-11T10:31:00.627 回答