4

I have installed and tried to configure the cucumber preprocessor package to implement cucumber into an existing cypress framework. But when I go and run my Feature file I get the following error. Any ideas?

Error: Can't walk dependency graph: Cannot find module './commands' from 'C:\Source\CoreDevGit\Src\Project\Project.Web.CypressTests\cypress\support' required by C:\Source\CoreDevGit\Src\Project\Project.Web.CypressTests\cypress\support\index.js

plugins/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');
Aidan
  • 79
  • 3
  • 11

1 Answers1

1

My project needed the following command to give support to typescript. It worked after that.

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

Aidan
  • 79
  • 3
  • 11
  • This did not resolve the error for me. Also it shouldn't be related, because the command above only adds types. However, the error message is rather saying that it can't resolve a path (for me it is a path defined in tsconfig). – dave0688 Oct 17 '22 at 14:30