繁体   English   中英

每当我尝试运行 Cypress Suite 时都会出现以下错误

[英]Getting below error whenever I try to run Cypress Suite

错误:在 D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve 的“D:\Automation Code\Cypress\cypress-ui-automation\cypress\support”中找不到模块“cypress-xpath” \node_modules\resolve\lib\async.js:46:17 在进程(D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43 ) 在 ondir (D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)

看起来您错过了cypress-xpath的安装。

如果您使用 npm 安装:

npm install -D cypress-xpath

或者如果您使用纱线安装:

yarn add cypress-xpath --dev

您显然已经在\cypress\support中有 require 语句,因为这是错误堆栈中的第一条路径。

假设已经安装了cypress-xpath插件,在cypress/support/e2e.js你必须添加这个:

require('cypress-xpath');

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM