Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ENOENT: no such file or directory #1265

Open
newtonspt opened this issue Dec 30, 2024 · 5 comments
Open

Error: ENOENT: no such file or directory #1265

newtonspt opened this issue Dec 30, 2024 · 5 comments

Comments

@newtonspt
Copy link

newtonspt commented Dec 30, 2024

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

  • [ x ] I've read the FAQ.
  • [ x ] I've read instructions for logging issues.
  • [ x ] I'm not using cypress-cucumber-preprocessor@4.3.1 (package name has changed and it is no longer the most recent version, see #689).
@badeball
Copy link
Owner

badeball commented Jan 2, 2025

This comes up from time to time, but I'm not able to reproduce the issue. Are you able to construct a step-by-step guide that consistently reproduces this?

@newtonspt
Copy link
Author

I built another project in my documents and when I try to execute it, displays this error. I see inside the directory that there isn't this file feature, I believe being a token because when I copy the OA_Tool.feature to the directory, it displays another issue such as token failure. I believe Cypress creates this file automatically.
I have another project in my desktop folder and runs well.

1 - npx cypress open
2 - Hit the browser
3- execute the feature.

Error: ENOENT: no such file or directory, stat 'C:\Users\9874374324\AppData\Roaming\Cypress\cy\production\projects\Project-52c4c2a822c3c1529f5b499dd4733ed6\bundles\cypress\e2e\OA_ear_regression\OA_Tool.feature'

@mahmost
Copy link

mahmost commented Jan 8, 2025

I had the same issue, I want to add that in my case when I run headless using cypress run (instead of cypress open), it runs as expected .. and later on .. only specs that was run headless are able to be run from the GUI (using cypress open)

@LeJeanbono
Copy link

I had the same problem.
It was a compilation error on my files in e2e folder, take a look in your console

@Arthurferrera
Copy link

I had the same problem.

I solved it partially by removing "cypress-cucumber-preprocessor" from my package.json.

I kept "@badeball/cypress-cucumber-preprocessor": "^20.1.2".

But when I change my .feature file, the changes do not reflect in the Cypress test.

Does anyone have any suggestions on how to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants