首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >步骤定义未实现- Cucumber with Angular9 & Serenity/JS

步骤定义未实现- Cucumber with Angular9 & Serenity/JS
EN

Stack Overflow用户
提问于 2020-07-22 21:29:59
回答 1查看 269关注 0票数 1

当我使用protractor e2e/protractor.conf.js运行黄瓜步骤定义时,测试报告返回:

代码语言:javascript
复制
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.

这是在Serenity/JS中编写的步骤定义:

代码语言:javascript
复制
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'))
  );
});

我试过:

对于调整我的there

  • Uninstalling文件的
  • ,我没有发现任何错误&重新安装宁静/js&的依赖项

cucumber

  • Rewriting my step definitions

  • Doing在每一步中将"ExecutionSuccessful“力返回到量角器--宁静/JS‘s GitHub

上的黄瓜示例

每一件事都导致了同样的错误。

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

EN

回答 1

Stack Overflow用户

发布于 2020-08-14 09:04:33

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

所以不用specs/**/*.ts,我需要使用e2e/src/specs/**/*.ts

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63043492

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档