TestCafe Live没有运行 [英] Testcafe live not running

查看:134
本文介绍了TestCafe Live没有运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OsX上,使用节点10.1.5.3的nvm. Testscafe(非实时)工作正常,但我试图按照 Testcafe-live 中的说明进行操作

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

如果您已经在本地将testcafe-live安装到项目中,请添加一个 将npm脚本打包到package.json以运行测试:

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

它指向package.json文件,我在脚本部分下添加了该条目

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/"
  },

但是当我跑步

npm运行testcafe-live

npm run testcafe-live

我得到这些错误:

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

我看到package.json路径有问题,我的package.json文件在〜/testcafe/node_modules/testcafe-live中,但是npm正在查看/Users/Thomas.Pavan/testcafe/. 如果将testcafe-live安装在项目根文件夹的错误位置(当前位于〜/testcafe)中,我会感到困惑,而且我也不明白在哪里可以更改错误中显示的路径. 长话短说,package.json文件应位于我的文件夹的根目录中,但请按照说明安装testcafe-live,创建一个node_modules文件夹,并将package.json文件嵌套在其中.

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.

推荐答案

感谢您对TestCafe的关注. 从版本1.0.0开始,TestCafe具有内置的实时模式功能,并且不需要任何外部模块.您提到的存储库现在已过时. 请参阅以下文章以获取更多详细信息 https ://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/live-mode.html

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  

这篇关于TestCafe Live没有运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆