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

cypress doesn't wait for preprocessor to compile the.feature file #1247

Open
3 tasks done
mysticdevx opened this issue Oct 6, 2024 · 4 comments
Open
3 tasks done

Comments

@mysticdevx
Copy link

Current behavior

When cypress has the watchForFileChanges: false config setting that disables cypress run after each test file modification, then cypress doesn't wait for .feature file to be compiled. That results us to run the feature file twice if the file is new, and worst is, it doesn't reflect the latest change in the existing test code unless we run it twice. (i.e. for an existing test, I change, say an assertion, and when i run the test, it uses the previously compiled .feature file bc cypress doesnt wait for the new compilation, and uses the existing one)

Example SS

Screenshot 2024-10-06 at 14 54 34

Desired behavior

It would be nice, if tests start after preprocessor compiles the feature file, so that we can use the watchForFileChanges: false that makes test development easier. (otherwise cypress keeps running during development after each change)

Some workarounds are listed here, however neither of them works. Therefore i needed to open an issue.

Thanks.

Test code to reproduce

You can use this repo.

Versions

  • Cypress version: 13.15.0
  • Preprocessor version: 21.0.2
  • Node version: 18.20.2

Checklist

@badeball
Copy link
Owner

badeball commented Oct 6, 2024

Hi @mysticdevx, you need to clearly outline the steps needed to exemplify the undesired behavior. Furthermore, since I suspect this has something to do with bahmutov/cypress-esbuild-preprocessor#380, I ask that you try this using non-cucumber tests while using the esbuild bundler, to see if it is infact there the problem lies.

@mysticdevx
Copy link
Author

I dont think its about compile error, bc the files are compiled, just its too late for cypress to detect the changes (I say this bc when watch mode is true, i see cypress runs twice in very small interval of time, and when watch mode is false every second attpemt make it run).

But ok, its logical to isolate the issue if its only about cucumber preprocessor - i dint think of it :( I'll try with non-cucumber / esbuild preprocessor to isolate the issue, then if necessary will add steps to reproduce. Thanks.

@nids2307
Copy link

Any luck getting this issue resolved? I have run into it sporadically multiple times with no clear steps to resolve. Hit and trial with different steps sometimes work though, example:
Yarn cache clean
Install newer version of Cypress
Updated preprocessor and esbuild-preprocessor dependencies and reverted back, tried different versions of testing library as well
Cypress cache clear and reinstall Cypress
Clear content of Developer Tools-App Data
Delete the local instance of the project and rebuild from BB

@MDG-JHowley
Copy link

This works for me: bahmutov/cypress-esbuild-preprocessor#195 (comment)

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

4 participants