2016-11-03 5 views
0

私はグルーヴィー(Mavenのない構造)であるかのプロジェクトを持っている、と私は機能を確認する際キュウリのGroovyプロジェクトから欠落しているステップを定義する方法はありますか?

Feature: API Authentication Functionality 

@Api @General 
Scenario: I cannot log in to the API with bad credentials 
Given the following users are defined: 
    | USER_EMAIL    | RAW_PASSWORD  | 
    | [email protected] | YesGoodPassword! | 
And I use the username '[email protected]' 
    And I use the password 'UhOhWrongWord!' 
    When I log in to the API 
    Then the response is forbidden 

@Api @General 
    Scenario: I log in to the API 
    Given the following users are defined: 
    | USER_EMAIL    | RAW_PASSWORD  | 
     | [email protected] | YesGoodPassword! | 
    And I use the username '[email protected]' 
    And I use the password 'YesGoodPassword!' 
    When I log in to the API 
    Then the response is valid 
    And the response includes a token 

である。しかしステップで、この警告が表示されます:

step the following users are defined does not have a matching glue code

ステップ構造が似ています:AuthenticationSteps.groovy

と私はそれが私にこのエラーを与えた実行します。

Exception in thread "main" java.lang.ExceptionInInitializerError 
    at java.lang.Class.forName0(Native Method) 
    at java.lang.Class.forName(Unknown Source) 
    at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:68) 
    at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:65) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:65) 
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:162) 
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) 
    at com.reachforce.tools.db.DataSourceFactory.<init>(DataSourceFactory.groovy:12) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83) 
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105) 
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:239) 
    at com.reachforce.config.ValidationConfig.<init>(ValidationConfig.groovy:31) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at java.lang.Class.newInstance(Unknown Source) 
    at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:436) 
    at groovy.lang.GroovyShell.parse(GroovyShell.java:700) 
    at groovy.lang.GroovyShell.parse(GroovyShell.java:680) 
    at cucumber.runtime.groovy.GroovyBackend.parse(GroovyBackend.java:115) 
    at cucumber.runtime.groovy.GroovyBackend.loadGlue(GroovyBackend.java:76) 
    at cucumber.runtime.Runtime.<init>(Runtime.java:91) 
    at cucumber.runtime.Runtime.<init>(Runtime.java:69) 
    at cucumber.runtime.Runtime.<init>(Runtime.java:65) 
    at cucumber.api.cli.Main.run(Main.java:35) 
    at cucumber.api.cli.Main.main(Main.java:18) 
Caused by: java.io.FileNotFoundException: \etc\validation\validation.properties (El sistema no puede encontrar la ruta especificada) 
    at java.io.FileInputStream.open0(Native Method) 
    at java.io.FileInputStream.open(Unknown Source) 
    at java.io.FileInputStream.<init>(Unknown Source) 
    at java.io.FileInputStream.<init>(Unknown Source) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83) 
    at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77) 
    at org.codehaus.groovy.runtime.callsite.ConstructorSite.callConstructor(ConstructorSite.java:45) 
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235) 
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247) 
    at com.reachforce.config.ValidationEnvironment.<clinit>(ValidationEnvironment.groovy:10) 
... 36 more 

助けが必要ですか?

+0

あなたはあなたの手順を定義する「ステップ定義」のような何かを持っている必要があります。そのステップがそこにないか、または間違った方法で定義されているように見えます。 – Ievgen

+0

私は通常、ランナーパッケージにステップ定義を宣言します.JAVAで行うと...しかしgroovyでは、このランナーパッケージがありません。どこで見つけることができますか? –

+0

私はそれについてはわかりません、私はgrrovy +キュウリで働いていません。ここをクリックして調べることができます。https://github.com/cucumber/cucumber-jvm/tree/master/groovy – Ievgen

答えて

0

あなたのキュウリのプラグインのように、ステップ定義クラスが見つかりません。

  • あなたのフォルダ構造がプラグインが期待している以外のものであれば、あなたの機能とステップ定義の場所を指してビルドファイルに入れておく必要があります。

Groovyのステップの定義とキュウリを実行しているため、この例を見ているようにしてください: Cucumber-jvm-groovy-example

関連する問題