cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.69k stars 3.16k forks source link

Cypress Component Testing seems to ignore `watchForFileChanges: false` #19220

Closed obeobe closed 1 year ago

obeobe commented 2 years ago

Current behavior

Setting watchForFileChanges to false seems to have no effect in component testing (i.e. when starting Cypress with npx cypress open-ct).

It does work with regular Cypress (i.e. npx cypress open).

I tried with and without adding it under the component key in addition to root - and in both cases it didn't work.

Desired behavior

Cypress should not refresh and restart the test when the spec file changes when the watchForFileChanges flag is set to false.

Test code to reproduce

My cypress.json:

{
    "watchForFileChanges": false,
    "experimentalStudio": true,
    "integrationFolder": "cypress/integration",
    "video": false,
    "defaultCommandTimeout": 8000,
    "component": {
        "watchForFileChanges": false,
        "defaultCommandTimeout": 10,
        "viewportHeight": 500,
        "viewportWidth": 700
    }
}

Code:

describe("test", () => {
    it("test", () => {
        expect(42).to.equal(42);
    });
});

And then make a change in the file, and save.

Cypress Version

8.7.0 (currently the latest 8.* version)

Other

It's a big issue because IntelliJ saves files automatically and it causes many undesired refreshes.

lmiller1990 commented 1 year ago

For now you can do it on a dev server basis:

We should fix this.

cypress-app-bot commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

cypress-app-bot commented 1 year ago

This issue has been closed due to inactivity.