schattenjager
schattenjager

Reputation: 105

Testcafe live not running

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.

Upvotes: 3

Views: 650

Answers (1)

Alex Kamaev
Alex Kamaev

Reputation: 6318

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  

Upvotes: 6

Related Questions