我打不开赛普拉斯

Hth*_*ien 4 visual-studio node.js cypress

  1. 我安装节点js和visual studio代码,创建一个文件夹并打开cmd
  2. 输入 npm init
  3. 输入 npm install cypress 等待完成
  4. 我打开 Visual Studio 代码并运行命令: “./node_modules/.bin/cypress open” 但什么也没发生。赛普拉斯打不开。我尝试使用其他方式使用:npm run cypress:open但它也没有打开。

我在 Window 10 上运行,节点 js 8.12,visual studio 代码版本 1.27.2 在其他 PC 中,cypress 在终端中与 Windows PowerShell 一起正常工作,但在错误 PC 上,它只能与 cmd 一起运行。

Vad*_*aev 12

在 Windows 的路径中使用\代替/

.\node_modules\.bin\cypress open
Run Code Online (Sandbox Code Playgroud)

为了通过此命令运行 cypress,npm run cypress:open您需要添加"cypress:open": "cypress open"到文件中的scripts字段package.json

{
  "scripts": {
    "cypress:open": "cypress open"
  }
}
Run Code Online (Sandbox Code Playgroud)


小智 5

package.json在文件中添加以下行代码

{
  "scripts": {
    "test": "cypress open"
  }
}
Run Code Online (Sandbox Code Playgroud)

并使用下面的命令提示符运行 cypress thro' 编辑器命令提示符

npm run test
Run Code Online (Sandbox Code Playgroud)