cypress-cucumber-preprocessor icon indicating copy to clipboard operation
cypress-cucumber-preprocessor copied to clipboard

Error: ENOENT: no such file or directory

Open newtonspt opened this issue 10 months ago • 5 comments

Current behavior

Hi all, I've been struggling with the issue for a long time, I had initially created a project file on my Desktop, and I needed to create another one in my Document path, I removed everything and installed it from scratch, even so happens this error. I don't know how to solve it, I saw some topics with it, but it didn't work.

I noticed that executing the command directly in my terminal, npx cypress run --spec "cypress/e2e/OA_ear_regression/OA_Tool.feature"

The Cypress runs well. It seems that the @badeball/cypress-cucumber-preprocessor/esbuild is using the cache, I guess.

image

Desired behavior

Cypress runs .feature tests on the browsers.

Test code to reproduce

This is my cypress.config.ts configured :

import { defineConfig } from "cypress";
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
import createEsbuildPlugin from "@badeball/cypress-cucumber-preprocessor/esbuild";

export default defineConfig({
  e2e: {
    specPattern: ['**/*.feature', 'cypress/e2e/api/**/*.cy.js'],
    async 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",
        createBundler({
          plugins: [createEsbuildPlugin(config)],
        })
      );

      // Make sure to return the config object as it might have been modified by the plugin.
      return config;
    },
  },
});

Versions

  • Cypress version: "cypress": "^13.17.0",
  • Preprocessor version: "@badeball/cypress-cucumber-preprocessor": "^21.0.3", "@bahmutov/cypress-esbuild-preprocessor": "^2.2.4",
  • Node version: v20.12.2

Checklist

newtonspt avatar Dec 30 '24 16:12 newtonspt