![](/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.