Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript &引用;未定义的步骤参考“;在WebStorm中尝试引用TypeScript步骤定义代码时_Javascript_Typescript_Cucumber_Webstorm_Gherkin - Fatal编程技术网

Javascript &引用;未定义的步骤参考“;在WebStorm中尝试引用TypeScript步骤定义代码时

Javascript &引用;未定义的步骤参考“;在WebStorm中尝试引用TypeScript步骤定义代码时,javascript,typescript,cucumber,webstorm,gherkin,Javascript,Typescript,Cucumber,Webstorm,Gherkin,在基于cucumber量角器typescript逻辑实现一些测试脚本时,我遇到了一个问题:我的小黄瓜找不到步骤声明: 步骤定义用TypeScript编码。但是,我的所有测试都编译并运行成功。 当我试图手动创建步骤定义文件时,没有创建TypeScript文件的选项,只有JavaScript: 以下是我的步骤定义示例: defineSupportCode(({Given, When, Then, Before}) => { let search: Search; Be

在基于cucumber量角器typescript逻辑实现一些测试脚本时,我遇到了一个问题:我的小黄瓜找不到步骤声明:

步骤定义用TypeScript编码。但是,我的所有测试都编译并运行成功。

当我试图手动创建步骤定义文件时,没有创建TypeScript文件的选项,只有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

有人知道如何解决这个问题吗?

不幸的是,WebStorm不支持用TypeScript编写Cucumber.js测试。请投票支持TypeScript,如有任何进展,请予以通知