Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.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
未实施步骤定义-黄瓜带Angular9&;宁静/JS_Angular_Protractor_Cucumberjs_Cucumber Serenity_Serenity Js - Fatal编程技术网

未实施步骤定义-黄瓜带Angular9&;宁静/JS

未实施步骤定义-黄瓜带Angular9&;宁静/JS,angular,protractor,cucumberjs,cucumber-serenity,serenity-js,Angular,Protractor,Cucumberjs,Cucumber Serenity,Serenity Js,当我使用dragrator e2e/dragrator.conf.js运行Cucumber步骤定义时,test reporter返回: Logging in to application: User navigates to site from outside company network Given User is not on company network ☕ImplementationPendingError: Step not implemented ☕Impleme

当我使用
dragrator e2e/dragrator.conf.js运行Cucumber步骤定义时,test reporter返回:

Logging in to application: User navigates to site from outside company network

  Given User is not on company network
    ☕ImplementationPendingError: Step not implemented

☕Implementation pending (51ms)

  ImplementationPendingError: Step not implemented
      at CucumberEventProtocolAdapter.outcomeFrom (C:\Users\akokayi\***-Mobile-Dashboard\node_modules\@serenity-js\cucumber\src\listeners\CucumberEventProtocolAdapter.ts:171:54)
      at EventEmitter.<anonymous> (C:\Users\akokayi\***-Mobile-Dashboard\node_modules\@serenity-js\cucumber\src\listeners\CucumberEventProtocolAdapter.ts:158:28)
      at EventEmitter.emit (events.js:327:22)
================================================================================
Execution Summary

Logging in to application: 1 pending, 1 total (51ms)

Total time: 51ms
Scenarios:  1
================================================================================
[17:13:19] I/launcher - 0 instance(s) of WebDriver still running
[17:13:19] I/launcher - chrome #01 failed 1 test(s)
[17:13:19] I/launcher - overall: 1 failed spec(s)
[17:13:19] E/launcher - Process exited with error code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! workshop1@0.0.0 test-cucumber: `protractor e2e/protractor.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the workshop1@0.0.0 test-cucumber script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我试过:

  • 调整我的dragrator.conf.js文件,我没有发现任何错误 那里
  • 卸载并重新安装serenity/js的依赖项&
    黄瓜
  • 重写我的步骤定义
  • 在每个步骤定义中强制返回“ExecutionSuccessful”
  • 将我的构建与上的量角器黄瓜示例进行比较 Serenity/JS的GitHub
每一件事都导致了同样的错误

为什么没有读取/实现我的步骤定义?

对于我(我使用Angular),cucumberOpts.require将需要指向相对于项目根的目录,而不是相对于projector.conf.js文件的目录

因此,我需要使用
e2e/src/specs/***.ts
,而不是
specs/***.ts
,(我使用Angular),cucucumberOpts.require需要指向相对于项目根的目录,而不是相对于dragrator.conf.js文件的目录

因此,我需要使用
e2e/src/specs/***.ts
,而不是
specs/***.ts

const John = Actor.named('John').whoCan(BrowseTheWeb.using(protractor.browser), browser.waitForAngularEnabled(true));

Given(/User is not on company network/, () => {
  John.attemptsTo(
    UseAngular.disableSynchronisation(),
    Navigate.to("google.com")
  ); 
});


When(/User navigates to application/, function () {
  John.attemptsTo(
    UseAngular.enableSynchronisation(),
    StartLocalServer.onPort(4200),
    Navigate.to('localhost:4200'));
});

Then(/Redirected to company homepage/, function () {
  John.attemptsTo(
    UseAngular.disableSynchronisation(),
    Navigate.to("***.org"),
    Ensure.that(Website.url(), equals('***.org'))
  );
});