Renaming or moving a file is not reflected in the runner
Current behavior
If you have the runner open and move or rename a file then this change is not beeing pickup by the runner. If you then click the moved or renamed file you get an error.
Error: Webpack Compilation Error
Desired behavior
Refresh the runner after an rename or update so you don't need to close and reopen cypress.
Test code to reproduce
- open the cypress runner
npx cypress open - click on a file to run it. This should just work
- rename or move the file (nothing happens in the runner)
- click or rerun the same file
- now you get an error
Error: Webpack Compilation Error
Cypress Version
10.1.0
Other
No response
Hi @bvanderneut, when I attempted to reproduce this I got the expected behavior. If you rename or move a file the runner Specs List should reflect that almost right away. If you rename a file that you happen to have open, the runner should kick you back to the Specs List like this, and let you choose a new spec to run:
Can you share some more details about your setup? Operating System, what project, what testing type? A reproducible example project where this happens would be ideal, or at least enough to try to get close to your environment, since this does sound a like a real problem that shouldn't happen unless there's a bug we don't know about.
The Webpack Compilation Error should not appear.
@marktnoonan i don't understand that you need more information if you just told that you can reproduce it?
But we have an NX cypress setup Windows based Cypress typescript version We test an Angular Application
Reproducable example is not possible because you need to move or rename a file :)
@bvanderneut Sorry if I was not clear. When I say I got the expected behavior, I mean I got the currently expected behavior where this is handled correctly - I could not reproduce what you described locally. Renaming/moving files is fine for me.
So the problem must involve something else beyond Cypress itself. It sounds like I should just try to reproduce on Windows and go from there.
I've been able to test this on Windows and it's working for me - renaming a spec updates the specs list and if I rename a running spec I get the proper warning.
It does sound like file watching is broken for you though. We have seen some other issues in Windows recently that seem to be related to paths in one way or another. Could you provide the full path for a file that Cypress does not react to when you update? That may point us to the problem, or at least give us the next thing to test.
rename-files.zip I made a small repro project. Hope this will help :)
Thanks @bvanderneut I confirmed with that project that file watching is broken for me as well. Now that we have a reproduction we'll route this to the team to work on.