2017-12-29 27 views
0

오이 - 각도기 - 유형 스크립트 논리를 기반으로 몇 가지 테스트 스크립트를 구현하는 동안 문제가 발생했습니다. 내 작은 오이 코드 (Cucumber features)는 선언을 찾을 수 없습니다. 단계 :WebStorm의 "정의되지 않은 단계 참조"에서 TypeScript 단계 정의 코드 참조

can not find declaration of steps

단계 정의 타이프로 코딩 하였다. 그러나 모든 테스트는 성공적으로 컴파일되고 실행됩니다. 내 오이 코드가 TypeScript 코드를 이해하지 못하는 것 같습니다. There is the same problem as mine, but it didn't solve my problem.

내가 수동 단계 정의 파일을 만들려고하고, 타이프 스크립트 파일을 만들 수있는 옵션이 없습니다 만 자바 스크립트 :

여기

When I am trying to create step definition file manually, there is no option to create TypeScript file, only JavaScript

단계 정의 타이프 라이터 코드의 내 예입니다

defineSupportCode(({Given, When, Then, Before}) => { 
     let search: Search; 

    Before(() => { 
     search = new Search(); 
    }); 

    Given(/^User on the angular site$/, async() => { 
     let title = await browser.getTitle(); 
     return expect(title).to.equal('Angular'); 
    }); 

    When(/^User type "(.*?)" into the search input field$/, async (text: string) => { 
     await search.enterSearchInput(text); 
    }); 

    Then(/^User should see some results in the search overlay$/, async() => { 
     await search.getSearchResultItems(); 
     let count = await search.getCountOfResults(); 
     return expect(count).to.be.above(0); 
    }); 
}); 

그리고 내 오이 파일 :

Feature: Search 
    As a developer using Angular 
    User need to look-up classes and guidelines 
    So that User can concentrate on building awesome apps 

@SearchScenario 
    Scenario: Type in a search-term 
    Given User on the angular site 
    When User type "foo" into the search input field 
    Then User should see some results in the search overlay 

내 저장소 구조 :

/features 
    /steps 
    searchSteps.ts 
search.feature 
/pages 
search.ts 

누군가는이 문제를 해결하는 방법을 알고 있습니까?

답변

1

불행히도 WebStorm은 TypeScript에서 Cucumber.js 테스트를 작성하는 기능을 지원하지 않습니다. TypeScript 지원으로 진행 상황을 통보 받으려면 WEB-22516WEB-29665에 투표하십시오.