我试图使用黄瓜JVM运行Cucumber场景,但我得到“没有找到Junit 4的测试”我目前没有使用maven。
我写了以下步骤定义
package stepd;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import pageobject.PageObject;
import cucumber.api.java.After;
import cucumber.api.java.Before;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class StepDefinition
{
private PageObject po;
private WebDriver driver;
public StepDefinition(WebDriver driver)
{
this.driver=driver;
po=new PageObject(driver);
}
@Given("^I navigate to the mock application$")
public void given_I_navigate_to_the_mock_application()
{
driver.get("http://demo.crowdperks.com/crowdperks");
}
@When("^I click login link$")
public void when_I_click_login_link()
{
driver.findElement(By.id("signup")).click();
}
@Then("^I should see Login page$")
public void then_I_login()
{
driver.findElement(By.id("username")).sendKeys("cplive");
driver.findElement(By.id("password")).sendKeys("cplive");
}
}
此外,当从测试运行器文件(即GenericTest)运行时,我没有在上下文菜单中以junit选项运行
请提供帮助