【发布时间】:2017-04-29 14:30:34
【问题描述】:
我在运行我的功能文件时遇到此错误
用法:java cucumber [options] [ [FILE|DIR][:LINE[:LINE]*] ]+
选项:
-g, --glue PATH Where glue code (step definitions and hooks) is loaded from.
-f, --format FORMAT[:PATH_OR_URL] How to format results. Goes to STDOUT unless PATH_OR_URL is specified.
Built-in FORMAT types: junit, html, pretty, progress, json.
FORMAT can also be a fully qualified class name.
-t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching TAG_EXPRESSION.
-n, --name REGEXP Only run scenarios whose names match REGEXP.
-d, --[no-]-dry-run Skip execution of glue code.
-m, --[no-]-monochrome Don't colour terminal output.
-s, --[no-]-strict Treat undefined and pending steps as errors.
--snippets Snippet name: underscore, camelcase
--dotcucumber PATH_OR_URL Where to write out runtime information. PATH_OR_URL can be a file system
path or a URL.
-v, --version Print version.
-h, --help You're looking at it.
Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin
at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44)
at cucumber.api.cli.Main.run(Main.java:20)
at cucumber.api.cli.Main.main(Main.java:16)
我的跑步者课
package cucumber;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith( value = Cucumber.class)
@CucumberOptions(dryRun = false, strict = true,
features="/STAF/src/main/java/CucumberFeature/GmailLoginLogout.feature/",
tags ={"~@/ReCall/src/SeleniumWithCucumber/FbTest.java"})
public class CucumberRunner {
}
我的功能文件
功能:Gmail 登录注销
场景:登录和退出 Gmail 给定打开 gmail 使用有效凭据登录时 然后主页应该来了
我的步骤定义
package StepDfination;
import org.openqa.selenium.WebDriver;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class GmailLoginLogout {
WebDriver driver;
@Given("^Open gmail$")
public void Open_gmail(){
System.out.println("gmailopened ");
}
@When("^Login with valide credential$")
public void Login_with_valide_credential(){
System.out.println("cridential entered");
}
@Then("^Home page should come$")
public void Home_page_should_come(){
System.out.println("in home page");
}
}
【问题讨论】:
-
您使用的 cli 命令是什么?如果您使用 cli 命令,则不需要运行器类,您可以在命令本身中提供所有选项。您是否尝试过将 runner 类作为 junit 测试类运行?
标签: selenium cucumber cucumber-jvm cucumberjs