Cypres reloads when config file is updated despite setting `watchForFileChanges: false`
See original GitHub issueCurrent behavior
This is really similar to this closed issue. Cypress doesn’t watch my spec files for changes, but it does watch my configs.
Desired behavior
cypress should not watch any files for changes.
Test code to reproduce
start a test with watchForFileChanges: false
and make a change to a cypress.config.js
or any of it’s requirements.
Cypress Version
10.0.3
Other
my full defineConfig looks like this. though i doubt the settings are stepping over each other
...
module.exports = defineConfig({
env: {
// some stuff here
},
chromeWebSecurity: false,
watchForFileChanges: false,
viewportWidth: 1280,
viewportHeight: 720,
videoUploadOnPasses: false,
e2e: {
baseUrl,
setupNodeEvents(on, config) {
// log printer
const log_printer_options = {
outputRoot: config.projectRoot + "/cypress/",
printLogsToFile: "always",
// Used to trim the base path of specs and reduce nesting in the
// generated output directory.
specRoot: path.relative(config.fileServerFolder, config.specPattern.split("*")[0]),
outputTarget: {
"logs|txt": "txt",
},
// these defaults are not being handled as expected in plugin, setting explicitly until fixed upstream
commandTrimLength: 2000,
defaultTrimLength: 2000,
};
require("cypress-terminal-report/src/installLogsPrinter")(on, log_printer_options);
},
experimentalSessionAndOrigin: true,
},
});
Issue Analytics
- State:
- Created a year ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Cypress App reload in the middle of a test run if config file is ...
Current behavior I was working on updating Cypress to v10 in our project and was running some tests with 'cypress open' locally.
Read more >Configuration - Cypress Documentation
This guide is for Cypress 10 and the new JavaScript configuration file format. ... watchForFileChanges, true, Whether Cypress will watch and restart tests ......
Read more >Cypress - automatically run all tests in browser, with hot reload
If you run Cypress tests headlessly cypress run it runs all tests ... the global configuration option watchForFileChanges as detailed here.
Read more >Configurations in Cypress and How to Disable Default ...
This configuration specifies whether Cypress will watch and restart tests on any runtime changes in the test files. What are the default ...
Read more >Writing and Organizing Tests - cypress - w3resource
You can set watchForFileChanges configuration property to false to disable file watching. . Follow us on Facebook for latest updates. Exercises ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
even if i’m not checking out. it’s still annoying to make trival changes to my config, like a comment, and then watch my test progress disappear. that’s why i opted into
watchForFileChanges: false
in the first place. If this is all still intended, then I guess I’d convert this ticket to a feature request for awatchForAllFileChanges
optionYeah just as I thought. a few issues with
run --headed
.not a good dev experience.
One other thing. How come y’all change behavior when the config is broken? It’s like sometimes you watch for changes, and sometimes you explicitly ask for me to retry. which is it?