简体   繁体   English

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

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

Error: Cannot find module 'cypress-xpath' from 'D:\Automation Code\Cypress\cypress-ui-automation\cypress\support' at D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17 at process (D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43) at ondir (D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)错误:在 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)

It looks like you have missed the install of cypress-xpath .看起来您错过了cypress-xpath的安装。

If you are installing with npm:如果您使用 npm 安装:

npm install -D cypress-xpath

or if you are installing with yarn:或者如果您使用纱线安装:

yarn add cypress-xpath --dev

You clearly already have the the require statement in \cypress\support since that is the first path in the error stack.您显然已经在\cypress\support中有 require 语句,因为这是错误堆栈中的第一条路径。

Assuming that the cypress-xpath plugin is already installed, Under cypress/support/e2e.js you have to add this:假设已经安装了cypress-xpath插件,在cypress/support/e2e.js你必须添加这个:

require('cypress-xpath');

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

相关问题 每当我尝试在 VScode 终端中运行 cypress run --record --key xxxx 时,都会收到一条错误消息 - I get an error message whenever I try to run the cypress run --record --key xxxx in VScode terminal 每当我运行它时都会收到 NaN 错误? - I'm getting an NaN error whenever I run this? 每当我尝试创建新的反应应用程序或尝试启动现有的反应应用程序时出现错误 - Getting error whenever I try to create new react app or try to start existing react app 每当我尝试在 Visual Studio 代码上运行“npm install”时出现错误 - I get an error whenever i try to run "npm install" on visual studio code 每当我在 react 上运行 npm start 时,它都会出错。 下图 - whenever i run npm start on my react it gives an error. Image below 我尝试运行柏树,但总是返回错误“不支持 dri3 扩展” - I try to run cypress, but always return me a error "dri3 extension not supported" 当我运行用JavaScript编写的invoke应用时遇到以下错误 - Getting below error when i run the invoke app written in javascript 尝试运行此应用时收到setOnClickListener错误 - Getting a setOnClickListener error when I try to run this app 当我尝试在 android 上运行 React Native 应用程序时出错 - getting error when i try to run react native app on android 每当我尝试编译 javascript 代码时,都会出现语法错误 - Whenever I try to compile javascript code I get a syntax error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM