![](/img/trans.png)
[英]I get an error message whenever I try to run the cypress run --record --key xxxx in VScode terminal
[英]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.