2014-10-03 5 views
0

커맨드 라인을 통해 메이븐 오이 -JVM 프로젝트를 실행하는 데 어려움을 겪고 있습니다.이 프로젝트는 일식 환경에서 잘 작동하지만, 정말 바보 같은 실수를 저지르고 있습니다. 몇 가지 중 하나가 될 수있는 것을 지적 할 수있다, 나는 오이커 메이븐 커맨드 라인

<mainClass>cucumber.api.cli.Main</mainClass> 
      <includePluginDependencies>true</includePluginDependencies> 
      <arguments> 
       <argument>--format</argument> 
       <argument>junit:target/cucumber-junit-report/allcukes.xml</argument> 
       <argument>--format</argument> 
       <argument>pretty</argument> 
       <argument>--format</argument> 
       <argument>html:target/cucumber-html-report</argument> 
       <argument>--tags</argument> 
       <argument>@kings</argument> 
       <argument>--glue</argument> 
       <argument>com/Science_Ware/Bilal/KingsPostLogin/</argument> 
       <argument>src/test/resources</argument> 

      </arguments> 

이 위 내 pom.xml 파일과 나는 오류가있을 수 느끼는 내 클래스 디렉토리, 아래 오류 이미지를 첨부됩니다. 내 기능 파일은 src/test/resources에 있고 내 단계 클래스 경로는 com.Science_Ware.Bilal.KingsPostLogin이고 내 Classname은 KingsPostLogin입니다.

C:\Users\********\My Documents\EclipseWork\Science-Ware>mvn exec:java 
[INFO] Scanning for projects... 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Science-Ware 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- exec-maven-plugin:1.3.2:java (default-cli) @ Science-Ware --- 
[WARNING] Warning: killAfter is now deprecated. Do you need it ? Please comment 
on MEXEC-6. 
Feature: Login and clicking on Content Containers 

    In Order to Work in Microsoft 
    I want to log in 
    and verify content containers 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal/Ki 
ngsPostLogin/kingspostlogin.feature:7←[0m 
    ←[36mGiven ←[0m←[36mI am logged into system on "Mozilla"←[0m 
    ←[36mAnd ←[0m←[36mI click on "<Content_Container>"←[0m 
    ←[36mThen ←[0m←[36mProcess should be "<Expected_Result>"←[0m 

    Examples: 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal/Ki 
ngsPostLogin/kingspostlogin.feature:15←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "OrderCentre"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "OrderCentreTitle"←[0m 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal/ 
KingsPostLogin/kingspostlogin.feature:16←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "AggregateOrders"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "AggregateOrdersTitle"←[0m 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal/ 
KingsPostLogin/kingspostlogin.feature:17←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "FreeFormatOrder"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "FreeFormatOrderTitle"←[0m 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal/Ki 
ngsPostLogin/kingspostlogin.feature:18←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "GetAQuote"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "GetAQuoteTitle"←[0m 

    @kings 
    Scenario Outline: Loggin in Science Warehouse  ←[90m# com/Science_Ware/Bila 
l/KingsPostLogin/kingspostlogin.feature:19←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "ComputerEquipment"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "ComputerEquipmentTitle"←[0m 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal/Ki 
ngsPostLogin/kingspostlogin.feature:20←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "Oligos"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "OligosTitle"←[0m 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal/Ki 
ngsPostLogin/kingspostlogin.feature:21←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "eTracker"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "eTrackerTitle"←[0m 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal 
/KingsPostLogin/kingspostlogin.feature:22←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "BrowseCategories"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "BrowseCategoriesTitle"←[0m 

    @kings 
    Scenario Outline: Loggin in Science Warehouse ←[90m# com/Science_Ware/Bilal/ 
KingsPostLogin/kingspostlogin.feature:23←[0m 
    ←[33mGiven ←[0m←[33mI am logged into system on "Mozilla"←[0m 
    ←[33mAnd ←[0m←[33mI click on "BrowseSuppliers"←[0m 
    ←[33mThen ←[0m←[33mProcess should be "BrowseSuppliersTitle"←[0m 

9 Scenarios (←[33m9 undefined←[0m) 
27 Steps (←[33m27 undefined←[0m) 
0m0.000s 


You can implement missing steps with the snippets below: 

@Given("^I am logged into system on \"(.*?)\"$") 
public void i_am_logged_into_system_on(String arg1) throws Throwable { 
    // Write code here that turns the phrase above into concrete actions 
    throw new PendingException(); 
} 

@Given("^I click on \"(.*?)\"$") 
public void i_click_on(String arg1) throws Throwable { 
    // Write code here that turns the phrase above into concrete actions 
    throw new PendingException(); 
} 

@Then("^Process should be \"(.*?)\"$") 
public void process_should_be(String arg1) throws Throwable { 
    // Write code here that turns the phrase above into concrete actions 
    throw new PendingException(); 
} 

위의 단계는 내 단계 방법을 호출하지 않는 명령 줄 실행입니다. 그들은 출력없이 실행됩니다. 실행할 mvn exec : java 명령을 사용하고 있습니다.

+0

그래서 단계 파일에 여러 가지 메소드가 누락되었습니다. 오류는 다음과 같이 알려줍니다. – Reimeus

+0

이 단계를 제공하는 클래스 파일이 이미 있습니다. 두 번째는 @And 여야합니다. 또한 나는 그냥 내 러너 클래스를 통과하고 잘 작동, 명령 프롬프트를 통해 문제가 발생했습니다 – user1584614

+0

단계 파일은 사실'com/Science_Ware/Bilal/KingsPostLogin /'에 있습니까? 그것이 오이가 그들을 찾을 수없는 것 같습니다. – Marit

답변

1

두 가지 문제가 있다고 생각합니다. 우선, 커맨드 라인에서 오이를 실행해서는 안됩니다.

import cucumber.api.junit.Cucumber; 
import org.junit.runner.RunWith; 

@RunWith(Cucumber.class) 
@Cucumber.Options(
    // Enable one of these to run just some tests. Put regexp to match features in here. 
// name = {"^Preview"}, 
// name = {"^Save"}, 
// tags = { "@questionLibrary", "@addingCategory" }, 
    format = {"html:target/cucumber-html-report", "pretty:target/cucumber-json-report.json"}, 
    strict = true 
) 
public class RunCukesTest { 
} 

메이븐이 테스트를 실행, 오이 테스트 주자, 모든 기능을 찾을 멋진 JUnit 테스트 스위트를 생성하고 실행한다 : 그들을 실행하려면 너무 같아야 단위 테스트를 추가합니다. 그러면 문제가 테스트 실패로 표시됩니다.

두 번째 문제는 오이가 테스트에서 오류를 발견하여보고한다는 것입니다. 잘못된 것을 이해하기 위해 출력을주의 깊게 읽은 다음 기능 설명 및/또는 지원 코드를 수정해야합니다.

+0

나는 완벽하게 실행되는 러너 클래스를 이미 가지고 있는데, 커맨드 라인을 통해 이것을 실행할 때만 문제가 있습니다. 난 단지 젠킨스를 사용하여 실행할 수 있도록 커맨드 라인을 통해 이것을 실행해야합니다 – user1584614

+0

오이가 오류 출력의 끝 부분 근처에서 세 단계의 정의를 찾을 수 없기 때문에이 경우에 당신은 설정에 문제가있었습니다. –