Testcafe live not running

牧云@^-^@ 提交于 2020-06-15 09:25:51

问题


I am on OsX, using nvm, node 10.15.3. Testscafe (not live) works fine, but I was trying to follow the instructions at Testcafe-live

At the step where it explains how to install it locally

If you have installed testcafe-live locally to your project, add an npm script to package.json to run tests:

it refers to a package.json file, I added the entry under the scripts section

   "scripts": {
    "test": "eslint ./**/*.js",
    "testcafe-live": "testcafe-live chrome tests/"
  },

but when I run

npm run testcafe-live

I get these errors:

npm ERR! path /Users/Thomas.Pavan/testcafe/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/Thomas.Pavan/testcafe/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Thomas.Pavan/.npm/_logs/2019-03-11T14_58_28_946Z-debug.log

I see that the package.json path is the problem, my package.json file is in ~/testcafe/node_modules/testcafe-live but npm is looking at /Users/Thomas.Pavan/testcafe/. I'm confused if I installed testcafe-live in the wrong location (currently at ~/testcafe) my project root folder, and I also don't understand where I can change the path shown in the error. Long story short, the package.json file should be in the root of my folder but installing testcafe-live as instructed, creates a node_modules folder and the package.json file is nested there.


回答1:


Thank you for your interest in TestCafe. Starting from version 1.0.0 TestCafe has a built-in Live mode feature and it does not require any external module. The repository you mentioned is obsolete now. Please refer to the following article to get more details https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/live-mode.html  



来源:https://stackoverflow.com/questions/55105328/testcafe-live-not-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!