-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistFunctionality
Maintainability
Quality
User Experience
Internal
|
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/ |
@jennifer-shehane bit of a mix-up with accounts, but the CLA should be signed now. |
There was a problem hiding this 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!
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. |
@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. |
@gunna025 PRs without tests cannot be merged into the project. Will you have time to write tests? If not, we will have to close. |
@jennifer-shehane yes, I just did a little cleanup and added a few tests, let me know if there is anything else you need. |
There was a problem hiding this 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)
@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 😄 |
@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 |
Hey @gunna025, any update on the failing tests here? |
@jennifer-shehane Got a chance to look things over tonight, and fixed up the tests. |
packages/desktop-gui/cypress/integration/warning_message_spec.js
Outdated
Show resolved
Hide resolved
@gunna025 Thanks! Can you fix the merge conflicts? |
- only add retry button if it's the base url warning - keep warning around while waiting for retry - move tests to warning message spec
There was a problem hiding this 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.
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.
PR Tasks
cypress-documentation
?