2017-12-29 34 views
0

キュウリ - 分度器タイプスクリプトロジックに基づいていくつかのテストスクリプトを実装していましたが、私のGherkinコード(キュウリの機能)手順で:WebStormの "定義されていないステップリファレンス"はタイプスクリプトのステップ定義コードを参照しようとしています

can not find declaration of steps

手順の定義は、活字体でコード化されました。しかし、私のテストはすべてコンパイルされて正常に実行されます。私のキュウリのコードがTypeScriptのコードを理解していないようです。 There is the same problem as mine, but it didn't solve my problem.

私は手動でステップ定義ファイルを作成しようとしています、typescriptファイルを作成するためのオプションはありません、JavaScriptのみ:

ここ

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

ステップ定義typescriptですコードの私の例である:

は、
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テストを記述することはできません。 WEB-22516WEB-29665に投票してください。TypeScriptサポートの進捗状況については

関連する問題