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

[WIP] Update configuration change behavior #3211

Closed
wants to merge 45 commits into from

Conversation

lilaconlee
Copy link
Contributor

@lilaconlee lilaconlee commented Jan 23, 2019

User facing changelog

There is now a prompt to restart Cypress whenever changes are made to the project's configuration or plugin file instead of closing the Test Runner after changes.

Additional details

Problem

  • Whenever changes are made to cypress.json currently, we close the Test Runner completely. This is abrupt and oftentimes unexpected. It actually just looks like Cypress crashed.
  • Conversely, when changes are made to the plugins/index.js file, we just reload the file and do not close Cypress. This may mean that changes made to the plugins that only take effect when you restart the browser won't take effect and would likely cause confusion to the user.

Solution

  • Whenever changes are made to either the cypress.json or plugins/index.js file, we show a message in the Test Runner prompting them of the change and encouraging them to restart Cypress with a button.

How has the user experience changed?

Before when editing cypress.json or custom configFile in browser

  • Cypress kills Test Runner

After when editing cypress.json or custom configFile in browser

Screen Shot 2019-12-31 at 3 37 47 PM

Before when editing plugins/index.js in browser

No notice, but since I edited the browser flags, the browser flags will actually take no effect and I will be confused.

Screen Shot 2019-12-31 at 3 40 42 PM

After when editing plugins/index.js in browser

Screen Shot 2019-12-31 at 3 40 15 PM

Before when editing cypress.json or custom configFile in Desktop-GUI

  • DesktopGui refreshes with new value, possibly having an error shown

After when editing cypress.json, custom configFile, or plugins file in Desktop-GUI

Settings Tab

Screen Shot 2020-01-02 at 12 02 18 PM

Project Tab

Screen Shot 2020-01-02 at 12 06 19 PM

When multiple warnings, they just stack on top of each other.

Screen Shot 2020-01-06 at 4 36 32 PM

PR Tasks

  • Have tests been added/updated?
  • Has the original issue been tagged with a release in ZenHub?
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

@jennifer-shehane jennifer-shehane changed the base branch from develop to v3.2.0 January 24, 2019 18:32
@jennifer-shehane jennifer-shehane changed the base branch from v3.2.0 to develop January 24, 2019 18:32
packages/desktop-gui/src/projects/projects-api.js Outdated Show resolved Hide resolved
packages/desktop-gui/src/lib/ipc.js Outdated Show resolved Hide resolved
packages/server/lib/gui/events.coffee Outdated Show resolved Hide resolved
@jennifer-shehane jennifer-shehane self-assigned this Jul 3, 2019
@jennifer-shehane jennifer-shehane changed the title Update configuration change behavior [WIP] Update configuration change behavior Dec 30, 2019
@jennifer-shehane
Copy link
Member

This needs revisiting - removed as needing review at this time.

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Dec 31, 2019

I updated the original comment to fill in the requirements of the pull request template.

Maybe I messed up some things upon merge conflicts, but some initial observations:

  1. The path to the file shows the absolute path as opposed to the relative path to the project. This is not ideal.
  2. You can get rid of the notification by just refreshing / reloading the browser (without actually reloading the Cypress Test Runner). This does not seem ideal as it actually is not taking the changes into effect but the notification disappears. Fixed
  3. Clicking the restart button actually appears to do nothing (I probably broke this in merge conflicts). Fixed
  4. The notification does not show if a change was made to a pluginsFile other than the default one. So, I set a pluginsFile to a different path in my cypress.json, made a change to this file and there is no notification anymore.
  5. When clicking 'Restart' in the Desktop-GUI, relaunchBrowser is called (regardless of whether I had a browser open). This causes an uncaught exception because it's trying to call relaunchBrowser with spec.file, but spec is undefined because I was never running a spec to begin with. https://github.com/cypress-io/cypress/blob/issue-2869-config-changes/packages/desktop-gui/src/projects/projects-api.js#L73:L73
  6. Ran across a situation where the warnings continue to stack for some reason. This was when I was manually reloading the Desktop-GUI, so may not be a situation users can get into, but some state seems to not be resetting somewhere.

Screen Shot 2020-01-06 at 4 42 25 PM

Screen Shot 2020-01-06 at 4 43 36 PM

@cypress

This comment has been minimized.

@jennifer-shehane
Copy link
Member

I rewrote the reporter tests for the banner in Cypress and have confirmed that the reload:configuration event is being called when you click 'Restart', but the banner continues showing and does not go away. There never was a test for this, so this is likely a superficial UI problem rather than the config never reloading.

@jennifer-shehane
Copy link
Member

Unfortunately we have to close this PR due to inactivity. Please open a new PR addressing the original issue and any requested changes.

@chrisbreiding chrisbreiding deleted the issue-2869-config-changes branch April 5, 2022 18:28
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

Successfully merging this pull request may close these issues.

Improve how config changes are handled
4 participants