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

Adds retry button for project baseUrl warning #5325

Merged
merged 15 commits into from
Feb 27, 2020

Conversation

gunna025
Copy link
Contributor

@gunna025 gunna025 commented Oct 9, 2019

Closes #3284

User facing changelog

Adds a retry button for when the project baseUrl is unreachable

How has the user experience changed?

Users can now click a button to try again when they receive a warning that their server may not be running.

cypressWarningAfter

PR Tasks

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 9, 2019

Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.

  • Please write [WIP] in the title of your Pull Request if your PR is not ready for review - someone will review your PR as soon as the [WIP] is removed.
  • Please familiarize yourself with the PR Review Checklist and feel free to make updates on your PR based on these guidelines.

PR Review Checklist

Functionality

  • Does the code work? Does it perform its intended function, the logic is correct, etc?
  • Does the code guard against edge cases, invalid input, etc being entered? Are there tests for these?
  • Is any code invoking memory leaks? Has performance been factored in?

Maintainability

  • Is the code readable (too many nested 'if's are a bad sign.)
  • Do names used for variables, methods, etc, describe their function?
  • Is all the code easily understood? Are there relevant comments explaining?
  • Have algorithms been documented in the code? Is there a link to an external document? (flowcharts, w3c, chrome, firefox)

Quality

  • Is there a comment containing a link to the issue this is fixing (in tests and code)?
  • Does the change reimplement code that would be better served by pulling in a well known module from the ecosystem?
  • Is there any redundant or duplicate code?
  • Are tests actually testing the code’s intended functionality? Is there a more comprehensive test that could be written?
  • Are there any irrelevant comments left in the code?

User Experience

  • Is the feature/bugfix self-documenting from within the product (is there a way to explain this feature in product, so it doesn’t rely on resources outside, like docs)?
  • Are there any dead ends? Do we provide the end user with a way to fix their problem?

Internal

  • Has the original issue been tagged with a release in ZenHub?

@CLAassistant
Copy link

CLAassistant commented Oct 9, 2019

CLA assistant check
All committers have signed the CLA.

@jennifer-shehane
Copy link
Member

Hey @gunna025 Thanks for the contribution! Could you please sign our CLA?

Also ensure the author of the commits matches the email address on your GitHub account. Our CLA bot gets confused when they don't match. Here are some solutions to fixing when commits are linked to the wrong user: https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/

@gunna025
Copy link
Contributor Author

@jennifer-shehane bit of a mix-up with accounts, but the CLA should be signed now.

@andrew-codes andrew-codes self-requested a review October 16, 2019 20:41
Copy link
Contributor

@andrew-codes andrew-codes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi and thank you for contributing to Cypress! Upon further inspection, we think there is an alternative approach that we would like to investigate. We would love your help and participation. Below is an overview of the approach and the main places in code to find the various pieces. Hopefully, this different approach can avoid the need to reload the entire app to re-check the baseUrl.

desktop-gui has a ipc connection to server; which is where the actual validation of the baseUrl occurs. Although there is currently not a message to request the server to revalidate the baseUrl, we can add a new one.

This will involve registering the new event in ipc.js similar to these. Any additional implementation to check the baseUrl in server can be extracted and used for both server and the new events.coffee's handling of the message (similar to here).

Let us know if you have any additional questions. Thanks again for contributing!

@jennifer-shehane
Copy link
Member

Hey @gunna025, will you have time to address the changes asked by @andrew-codes? We will need to close this PR due to inactivity if not.

@gunna025
Copy link
Contributor Author

@jennifer-shehane, apologies for the delay on this. The project baseUrl retry should be working as @andrew-codes described above, however, I have not had a chance to add any tests.

@jennifer-shehane
Copy link
Member

@gunna025 PRs without tests cannot be merged into the project. Will you have time to write tests? If not, we will have to close.

@gunna025
Copy link
Contributor Author

@jennifer-shehane yes, I just did a little cleanup and added a few tests, let me know if there is anything else you need.

@jennifer-shehane jennifer-shehane requested review from andrew-codes and a team and removed request for a team and andrew-codes December 23, 2019 07:15
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gunna025 There is a relevant test failing, can you update this test in here? https://github.com/cypress-io/cypress/blob/develop/packages/desktop-gui/cypress/integration/error_message_spec.js#L1:L1

  1) Error Message re-opens project on click of 'Try again' button:
     CypressError: Timed out retrying: expected closeProject to have been called at least once, but it was never called
      at Object.cypressErr (cypress:///../driver/src/cypress/utils.coffee:157:11)
      at Object.throwErr (cypress:///../driver/src/cypress/utils.coffee:112:18)
      at Object.throwErrByPath (cypress:///../driver/src/cypress/utils.coffee:144:17)
      at retry (cypress:///../driver/src/cy/retries.coffee:55:16)
      at onFailFn (cypress:///../driver/src/cy/assertions.coffee:212:16)
      at tryCatcher (cypress:///./node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (cypress:///./node_modules/bluebird/js/release/promise.js:512:31)
      at Promise._settlePromise (cypress:///./node_modules/bluebird/js/release/promise.js:569:18)
      at Promise._settlePromise0 (cypress:///./node_modules/bluebird/js/release/promise.js:614:10)
      at Promise._settlePromises (cypress:///./node_modules/bluebird/js/release/promise.js:689:18)
      at Async._drainQueue (cypress:///./node_modules/bluebird/js/release/async.js:133:16)
      at Async._drainQueues (cypress:///./node_modules/bluebird/js/release/async.js:143:10)
      at Async.drainQueues (cypress:///./node_modules/bluebird/js/release/async.js:17:14)

@gunna025
Copy link
Contributor Author

gunna025 commented Jan 3, 2020

@jennifer-shehane Good catch. I guess I am a little too used to letting the compiler catch those issues, luckily there are some good tests 😄

@jennifer-shehane
Copy link
Member

@gunna025 There are stillsome failing tests in CI. Can you please run the tests locally before commiting to ensure all tests pass before getting into CI?

The desktop-gui warning_message_spec.js is failing.

@jennifer-shehane jennifer-shehane changed the title Adds retry button for project baseUrl warning [WIP] Adds retry button for project baseUrl warning Jan 9, 2020
@jennifer-shehane
Copy link
Member

Hey @gunna025, any update on the failing tests here?

@gunna025
Copy link
Contributor Author

@jennifer-shehane Got a chance to look things over tonight, and fixed up the tests.

packages/desktop-gui/src/project/project.jsx Outdated Show resolved Hide resolved
packages/desktop-gui/src/project/project.jsx Outdated Show resolved Hide resolved
packages/desktop-gui/src/project/project.jsx Outdated Show resolved Hide resolved
@jennifer-shehane
Copy link
Member

@gunna025 Thanks! Can you fix the merge conflicts?

@jennifer-shehane jennifer-shehane removed the request for review from andrew-codes February 26, 2020 07:56
@chrisbreiding chrisbreiding changed the title [WIP] Adds retry button for project baseUrl warning Adds retry button for project baseUrl warning Feb 26, 2020
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this manually - the functionality worked. The desktop-gui tests look good too.

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.

Be more user-friendly when checking that baseUrl server is responding
6 participants