2017-11-14 12 views
-2

``で認識取得されていません。 ランナークラス、機能ファイルとステップ定義locations.Iの添付のスクリーンショットをご覧くださいちょうど Stepdefinitionsステップの定義は、ランナーのステップの定義が実行されていない-test私のJavaキュウリの設定でテストランナー

package com; 

import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver; 

import cucumber.api.PendingException; 
import cucumber.api.java.After; 
import cucumber.api.java.Before; 
import cucumber.api.java.en.Given; 

public class StepDefinition { 
    WebDriver driver; 
    @Before 

    public void setUp(){ 
     driver=new FirefoxDriver(); 

    } 

    @After 
    public void tearDown(){ 
     driver.quit(); 
    } 

    @Given("^Launch the application$") 
    public void loadUrl() throws Throwable { 
     driver.get("https://www.google.com"); 

     throw new PendingException(); 
    } 




} 
+0

さらなる分析のためのテキストとして質問エリア内のステップの定義を貼り付けることを検討してください。 – DebanjanB

+0

私はちょうどURLを起動しています: – Bitz

+0

@Bitzグルーオプション値の場合、パスをjavaパッケージの観点から与える必要があります – Grasshopper

答えて

0

が1つのパッケージに、すべてのテストランナークラスを分離アプリケーション(com.tests)と、すべてのステップを立ち上げています別のパッケージ(com.stepDefs)内の定義クラスを削除します。次に、stepDefsパッケージを各テストランナーに貼り付けます。 Cucumber.Options @構文は@CucumberOptions私にとってであることを私はキュウリのJUnit 1.2.4を使用しています

、。

テンプレート構文:パッケージ名またはクラスパス(いないファイルシステムのパス)のいずれかに

@CucumberOptions(features = "src/test/resources/features/", 
      tags = {"@soWeb"}, 
      plugin = {"pretty","html:target/cucumber-html-report", 
        "json:target/cucumber-json-report.json" 
         }, 
      glue = "com.ba.StepDefs") 

public class AltoroMutual_TestRunner { 


} 
0

糊path引数。例えば、

glue = {"com"} 

または

glue = {"classpath:com"} 

あなたはJavaファイルを指しています。それに応じて変更してください。

関連する問題