"example table" 显示在 jbehave 中挂起
"example table" shows pending in jbehave
故事文件
When the user enters the required values as: <dataTable> in the text box
|sno|name|city_name|state_name|country_name|
|1|Bank of America|Chicago| | |
|2|JP Morgan | |Illinois | |
Steps.class
@When("the user enters the required values as: <dataTable> in the text box")
public void enterDetails(@Named("dataTable") ExamplesTable dataTable){
在我看到的输出中
When the user enters the required values as: <dataTable> in the text box (PENDING)
测试已通过,但步骤显示为待处理。
我也尝试使用以下 $ 参数。
故事文件
When the user enters the required values as: $dataTable in the text box
Steps.class
@When("the user enters the required values as: $dataTable in the text box")
public void enterDetails(ExamplesTable dataTable){
这次在下面的步骤中测试失败了。
When the user enters the required values as: $dataTable in the text box (FAILED)
(org.jbehave.core.io.StoryResourceNotFound: Story path '$dataTable' not found by class loader sun.misc.Launcher$AppClassLoader@18b4aac2)
谁能带我过来。我是否需要更新 Storyrunner 文件中的任何配置?如果是这样,请在这里说明一下。我已经查看了 JBehave 教程,但无法获得有关此的太多信息
http://jbehave.org/reference/stable/tabular-parameters.html
请注意我将 Jbehave 与 Gherkin 一起使用
扩展 JunitStories 的当前 storyrunner 文件
** @Override
public Configuration configuration() {
Class<? extends Embeddable> embeddableClass = this.getClass();
return new SeleniumConfiguration()
.useSeleniumContext(context)
.useWebDriverProvider(driverProvider)
.useStepMonitor(new SeleniumStepMonitor(contextView, context, new SilentStepMonitor()))
.useStoryLoader(new LoadFromClasspath(embeddableClass))
.useParameterConverters(new ParameterConverters().addConverters(new ParameterConverters.DateConverter(new SimpleDateFormat("yyyy-MM-dd"))))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(codeLocationFromClass(embeddableClass))
.withFormats(Format.STATS,
Format.CONSOLE,
Format.HTML
)
.withDefaultFormats()
.withFailureTrace(true));
}**
故事文件中的步骤语法:
When the user enters the required values as:
|sno|name |city_name|state_name|country_name|
|1 |Bank of America|Chicago | | |
in the text box
实施步骤:
@When("the user enters the required values as:$dataTablein the text box")
public void enterDetails(@Named("dataTable") ExamplesTable dataTable) {
// Put step implementation here
}
更多细节在官方文档中:
http://jbehave.org/reference/stable/tabular-parameters.html
故事文件
When the user enters the required values as: <dataTable> in the text box
|sno|name|city_name|state_name|country_name|
|1|Bank of America|Chicago| | |
|2|JP Morgan | |Illinois | |
Steps.class
@When("the user enters the required values as: <dataTable> in the text box")
public void enterDetails(@Named("dataTable") ExamplesTable dataTable){
在我看到的输出中
When the user enters the required values as: <dataTable> in the text box (PENDING)
测试已通过,但步骤显示为待处理。
我也尝试使用以下 $ 参数。
故事文件
When the user enters the required values as: $dataTable in the text box
Steps.class
@When("the user enters the required values as: $dataTable in the text box")
public void enterDetails(ExamplesTable dataTable){
这次在下面的步骤中测试失败了。
When the user enters the required values as: $dataTable in the text box (FAILED)
(org.jbehave.core.io.StoryResourceNotFound: Story path '$dataTable' not found by class loader sun.misc.Launcher$AppClassLoader@18b4aac2)
谁能带我过来。我是否需要更新 Storyrunner 文件中的任何配置?如果是这样,请在这里说明一下。我已经查看了 JBehave 教程,但无法获得有关此的太多信息 http://jbehave.org/reference/stable/tabular-parameters.html
请注意我将 Jbehave 与 Gherkin 一起使用
扩展 JunitStories 的当前 storyrunner 文件
** @Override
public Configuration configuration() {
Class<? extends Embeddable> embeddableClass = this.getClass();
return new SeleniumConfiguration()
.useSeleniumContext(context)
.useWebDriverProvider(driverProvider)
.useStepMonitor(new SeleniumStepMonitor(contextView, context, new SilentStepMonitor()))
.useStoryLoader(new LoadFromClasspath(embeddableClass))
.useParameterConverters(new ParameterConverters().addConverters(new ParameterConverters.DateConverter(new SimpleDateFormat("yyyy-MM-dd"))))
.useStoryReporterBuilder(new StoryReporterBuilder()
.withCodeLocation(codeLocationFromClass(embeddableClass))
.withFormats(Format.STATS,
Format.CONSOLE,
Format.HTML
)
.withDefaultFormats()
.withFailureTrace(true));
}**
故事文件中的步骤语法:
When the user enters the required values as:
|sno|name |city_name|state_name|country_name|
|1 |Bank of America|Chicago | | |
in the text box
实施步骤:
@When("the user enters the required values as:$dataTablein the text box")
public void enterDetails(@Named("dataTable") ExamplesTable dataTable) {
// Put step implementation here
}
更多细节在官方文档中: http://jbehave.org/reference/stable/tabular-parameters.html