如何解决@ 0.21.0上的tetscafe的问题(testcafe-live不起作用)

时间:2019-05-08 08:12:21

标签: node.js npm testcafe

将testcafe版本从0.21升级到0.23之后,我们遇到了testcafe-live无法正常工作的问题。

命令。

testcafe-live chrome tests/menu/test0001.ts --screenshots my-fixture/chrome --trace-warnings

控制台消息

(node:9808) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
at new TestRunner (D:\business\comp\Git\autotest\node_modules\testcafe-live\lib\test-runner.js:36:46)
at Controller.init (D:\business\comp\Git\autotest\node_modules\testcafe-live\lib\controller.js:26:27)
at tcArguments.parse.then (D:\business\comp\Git\autotest\node_modules\testcafe-live\lib\index.js:16:28)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
(node:9808) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9808) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我们尝试过的方法(但不起作用)

・删除node_modules并清除缓存

del node_modules
npm clean cache

・根据这个问题,修改了程序  https://github.com/DevExpress/testcafe-live/issues/25  https://github.com/DevExpress/testcafe-live/pull/30  (我不确定此问题与我的问题有关)

程序版本

"dependencies": {
    "@types/node": "^10.9.4",
    "testcafe": "^1.0.0",
    "testcafe-browser-provider-puppeteer": "^1.4.0",
    "testcafe-live": "^0.1.4"
  },

我尝试了testcafe @ 0.23.0、1.1.3、1.1.4,但无法正常工作

节点@ v8.11.3

npm @ 5.6.0

OS Windows10专业版

你能帮我吗?

1 个答案:

答案 0 :(得分:4)

现在已放弃单独的testcafe-live CLI实用程序。其所有功能都集成到testcafe实用程序Live mode中。使用testcafe --live ...代替testcafe-live ...