簡體   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