2

我已经安装并尝试配置 cucumber 预处理器包以将 cucumber 实现到现有的 cypress 框架中。但是当我去运行我的功能文件时,我收到以下错误。有任何想法吗?

错误:无法遍历依赖关系图:无法从 C:\Source\CoreDevGit\Src 所需的“C:\Source\CoreDevGit\Src\Project\Project.Web.CypressTests\cypress\support”中找到模块“./commands” \Project\Project.Web.CypressTests\cypress\support\index.js

插件/index.js

module.exports = (on, config) => {
  // `on` is used to hook into various events Cypress emits
  // `config` is the resolved Cypress config
  require('cypress-log-to-output').install(on, (type, event)=>{
    if (event.level === 'warning' || event.type === 'warning') {
      return false
    }
 
    return true
  })
};

module.exports = (on, config) => {
  
  on('before:browser:launch', (browser, launchOptions) => {
    if (browser.name === 'chrome' && browser.isHeadless) {
      launchOptions.args.push('--disable-gpu');
      return launchOptions
    }
  });
}

const cucumber = require('cypress-cucumber-preprocessor').default

module.exports = (on, config) => {
  on('file:preprocessor', cucumber())
};

require('@applitools/eyes-cypress')(module);
require('./mssql');
4

1 回答 1

0

我的项目需要以下命令来支持打字稿。在那之后它起作用了。

npm install --save-dev @types/cypress-cucumber-preprocessor

于 2021-05-17T14:59:33.287 回答