2016-06-12 7 views
4

機能ファイルを実行できません。私は以下のスタックトレースを取得しています
ファイルを実行しようとした時はいつでもキュウリ機能を実行できません

Exception in thread "main" Usage: java cucumber.api.cli.Main [options] [   
    [FILE|DIR][:LINE[:LINE]*] ]+ 
    Options: 

-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. 

    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) 

あなたのcukesファイルに正しくcucumberOptionsを設定しなかった場合は、通常、この問題を取得し、私は問題

+0

[キュウリのフィーチャファイルはMavenを使用して実行できません]の重複している可能性があります。(http://stackoverflow.com/questions/16727986/cucumber-feature-files-are-not-executed-using-maven) – deltree

+3

あなたはその電話をする。あなたの命令で何かが壊れていますが、私はそれが見えないので、何が間違っているかは分かりません。 –

+0

'--plugin'を使わないとうまくいきますか? – meatspace

答えて

1

を解決するために助けてください。例えば

@RunWith(Cucumber.class) 
@CucumberOptions(dryRun = false, strict = true, features = "src/test/features/com/sample", glue = "com.sample", 
    tags = { "[email protected]", "@executeThis" }, monochrome = true, 
    format = { "pretty", "html:target/cucumber", "json:target_json/cucumber.json", "junit:taget_junit/cucumber.xml" }) 
    public class RunCukeTest { 
    } 
1

こんにちは私も同様にこの問題を持っていた、と私はそれを解決するには、以下のなかった、ビデオhttps://youtu.be/pD4B839qfos からanushaをのコメントのおかげで-theメインのトリックは、まず変更することです次のようなjarファイルがあります。 cucumber-core-1.2.5.jar cucumber-java-1.2.5.jar cucumber-junit-1.2.5.jar または1.2.4以上から - また、次のselenium-server-standalone-2.42.0.jarを更新し、さらに を更新します。 matキーワードをプラグインに追加

上記の変更を行うと、問題が解決するはずです。

関連する問題