You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue while running the e2e Error: Can't walk dependency graph: Cannot find module '@dbh/e2e' from '/Users/.../src/support/index.ts'
Desired behavior
e2e are running fine with custom supportFile
Test code to reproduce
I have cypress.config.ts with the following settings:
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor';
import { preprocessor } from '@badeball/cypress-cucumber-preprocessor/browserify';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';
const defaultConfig = nxE2EPreset(__dirname);
async function setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions,
): Promise<Cypress.PluginConfigOptions> {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config);
on(
'file:preprocessor',
preprocessor(config, {
typescript: require.resolve('typescript'),
}),
);
// Make sure to return the config object as it might have been modified by the plugin.
return config;
}
export default defineConfig({
fileServerFolder: '.',
downloadsFolder: './src/downloads',
fixturesFolder: './src/fixtures',
modifyObstructiveCode: false,
video: false,
chromeWebSecurity: false,
e2e: {
...defaultConfig,
// It is not working with cucumber configurations, I don't know why, it just doesn't see the module path @dbh/e2e
supportFile: './src/support/index.ts',
// below is a configuration for the cucumber BDD approach, uncomment it to check how the test is running
setupNodeEvents: setupNodeEvents,
specPattern: '**/*.feature',
},
env: {
// Place values here which should be set as environment values. Usage: Cypress.env('SOME_ENV_VARIABLE')
},
});
Because of my custom supportFile I have this issue, whenever I comment supportFile: './src/support/index.ts', it works fine. In my supportFile I have exports of different helper functions, so I need to have this support file to be configured, the file looks like this:
import '@dbh/e2e';
In my tsconfig.json I have all configurations with path aliases included:
Not sure why this error occurs only when I have my custom setting of supportFile, I assume something could be wrong because of Nx, but I can not think of any specific reason.
Current behavior
Issue while running the e2e
Error: Can't walk dependency graph: Cannot find module '@dbh/e2e' from '/Users/.../src/support/index.ts'
Desired behavior
e2e are running fine with custom
supportFile
Test code to reproduce
I have
cypress.config.ts
with the following settings:Because of my custom
supportFile
I have this issue, whenever I commentsupportFile: './src/support/index.ts',
it works fine. In mysupportFile
I have exports of different helper functions, so I need to have this support file to be configured, the file looks like this:In my
tsconfig.json
I have all configurations with path aliases included:Not sure why this error occurs only when I have my custom setting of
supportFile
, I assume something could be wrong because of Nx, but I can not think of any specific reason.Appreciate any help here, thanks in advance.
Versions
Checklist
cypress-cucumber-preprocessor@4.3.1
(package name has changed and it is no longer the most recent version, see #689).The text was updated successfully, but these errors were encountered: