如何使用jbehave在eclipse上运行sikuli脚本?

如何使用jbehave在eclipse上运行sikuli脚本?,eclipse,bdd,jbehave,sikuli-script,Eclipse,Bdd,Jbehave,Sikuli Script,我刚刚发现了Sikuli,并设法让它在eclipse上运行。现在我正试图弄清楚我是否可以同时使用BDD,但我似乎无法让它们一起工作 我正在使用JBehave运行测试。以下是我目前掌握的情况: 故事文件 Scenario: Opening the orders list Given i am in the main menu When i click the orders button Then the orders list should be opened @ListaPedidosTes

我刚刚发现了Sikuli,并设法让它在eclipse上运行。现在我正试图弄清楚我是否可以同时使用BDD,但我似乎无法让它们一起工作

我正在使用JBehave运行测试。以下是我目前掌握的情况:

故事文件

Scenario:  Opening the orders list
Given i am in the main menu
When i click the orders button
Then the orders list should be opened
@ListaPedidosTeste
Feature:  Opening the orders list
Scenario: Opening the orders list

Given i am in the main menu
When i click the orders button
Then the orders list should be opened
步骤文件

Scenario:  Opening the orders list
Given i am in the main menu
When i click the orders button
Then the orders list should be opened
@ListaPedidosTeste
Feature:  Opening the orders list
Scenario: Opening the orders list

Given i am in the main menu
When i click the orders button
Then the orders list should be opened
package.com.test;
导入org.jbehave.core.annotations.Given;
导入org.jbehave.core.annotations.Then;
导入org.jbehave.core.annotations.When;
导入org.jbehave.core.steps.steps;
导入org.sikuli.script.FindFailed;
导入org.sikuli.script.Screen;
公共类AbrirListAgenedSteps扩展了Steps{
屏幕s;
公共AbriListAgempediDosSteps(){
s=新屏幕();
}
@给定(“我在主菜单中”)
public void发现系统失败{
s、 单击(“/com/test/images/editSenha.jpg”);
s、 类型(“1”);
s、 单击(“/com/test/images/btentrar.jpg”);
}
@当(“我点击订单按钮”)
public void iClickTheOrdersButton()抛出失败{
s、 单击(“/com/test/images/btnPedido.jpg”);
}
@然后(“应打开订单列表”)
public void orders stshouldbeopend()抛出失败{
s、 查找(“/com/test/images/listagepedidos”);
}
}
配置文件

Scenario:  Opening the orders list
Given i am in the main menu
When i click the orders button
Then the orders list should be opened
@ListaPedidosTeste
Feature:  Opening the orders list
Scenario: Opening the orders list

Given i am in the main menu
When i click the orders button
Then the orders list should be opened
package.com.test;
导入java.util.array;
导入java.util.List;
导入org.jbehave.core.configuration.configuration;
导入org.jbehave.core.configuration.mostuseveConfiguration;
导入org.jbehave.core.io.LoadFromClasspath;
导入org.jbehave.core.reporters.Format;
导入org.jbehave.core.reporters.StoryReporterBuilder;
导入org.jbehave.core.steps.InjectableStepsFactory;
导入org.jbehave.core.steps.InstanceStepsFactory;
导入org.sikuli.script.FindFailed;
导入org.sikuli.script.Sikulix;
公共类AbrirlistagePedidos扩展了Sikulix{
公共静态void main(字符串[]args)抛出FindFailed{
AbrirlistagePedidos测试=新AbrirlistagePedidos();
test.configuration();
test.stepsFactory();
test.storyPaths();
}
公共配置(){
返回新的mostuseveconfiguration()
.useStoryLoader(新的LoadFromClasspath(this.getClass()))
.useStoryReporterBuilder(
新的StoryReporterBuilder().withDefaultFormats().withFormats(Format.CONSOLE));
}
公共可注射步骤工厂步骤工厂(){
返回新InstanceStepsFactory(配置(),新AbrirlistagePediDosSteps());
}
受保护的列表故事路径(){
返回Arrays.asList(“/com/test/AbrirListagemPedidos.story”);
}
}
据我所知,Sikuli需要一个main[]方法来执行,所以我尝试了这种方法


我已经搜索了很多,但找不到关于如何使此设置工作的教程或其他内容。运行此命令没有错误,只是没有任何作用。

经过几次尝试后,我终于做到了,但使用Cucumber而不是JBehave

下面是最终代码

配置文件-AbrirListagemPedidos.java

package.com.test;
导入org.junit.runner.RunWith;
进口cucumber.api.CucumberOptions;
进口cucumber.api.junit.cucumber;
@RunWith(cumber.class)
@CucumberOptions(features=“path\u to\u project\u folder\\com\\test”,tags=“@listapedidoste”,
glue=“路径到项目文件夹\\com\\test\\stepdefinitions”,单色=true,干燥运行=false)*
公营课程简介{
}
功能文件-AbrirListagemPedidos.feature

Scenario:  Opening the orders list
Given i am in the main menu
When i click the orders button
Then the orders list should be opened
@ListaPedidosTeste
Feature:  Opening the orders list
Scenario: Opening the orders list

Given i am in the main menu
When i click the orders button
Then the orders list should be opened
步骤文件-abrirlistagepedidossteps.java

package com.test.step定义;
导入org.sikuli.script.Screen;
导入cucumber.api.java.en.Given;
导入cumber.api.java.en.Then;
导入cucumber.api.java.en.When;
公共类简化列表步骤{
屏幕s;
公共AbriListAgempediDosSteps(){
s=新屏幕();
}
@给定(“^i在主菜单中$”)
public void i_am_在主菜单中()抛出可丢弃{
s、 单击(“/com/test/images/editSenha.jpg”);
s、 类型(“1”);
s、 单击(“/com/test/images/btentrar.jpg”);
}
@当(^i单击订单按钮$)时
public void i\u单击\u orders\u按钮()可丢弃{
s、 单击(“/com/test/images/btnPedido.jpg”);
}
@然后(“^orders列表应打开$”)
public void应打开的订单列表可丢弃{
s、 查找(“/com/test/images/listagemPedidos.jpg”);
}
}