-
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
Command Timeout Progress Bar #7646
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
I'll clean it up later
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.
Threading options.timeout throughout the flow seems okay, but I’d like someone else to comment on this.
The UI code could be a bit cleaner and I left suggestions. The one I really care about is isolating the logic in the template into some sort of function or component. The Date stuff is a nitpick and just a suggestion to clean up the code and let you know there’s a diff way to spell it.
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.
This is really cool btw when you use it. 😄
-
So, it creates this 'jitter' effect due to the height of the command being 2px higher and then settling into the natural height of 2px less.
Typically you'd want to negate this by always having the height of the command consistent whether there's a progress bar or not.
-
The animations still play when using
.debug()
. Not sure how we want to handle this. -
I don't think progress bars are meant to be logged for just standard XHR requests / events that are not actual commands from Cypress. There is no 'timeout' for these completing, they respond when they respond.
-
This is what I meant when speaking of perf the other day. Some of the team said 'there will only be one progress bar at a time', but if you do something like the example below Performance issues of the Runner when using Cypress commands on many DOM elements at once #6967, it gets overwhelmed drawing 200+ wrap/invokes/asserts in the Command Log, all with progress bars.
There is a perf problem in general, so this PR doesn't introduce that!
With this PR, the example seems to be spending ~4sec more rendering though. And issuing a big warning about layout shift. (Perhaps because we're adding the element in with height and removing it - requiring layout to be recalculated).
I'd probably like someone else to verify though because I'm not that great with the performance tools.
it('perf', () => { cy.visit('https://entertainment.cathaypacific.com/catalog?template=movie&parent=Movies') cy.get('.carouselImage > poster-image > figure > picture > source', { timeout: 40000 }).each(source => { cy.wrap(source) .invoke('attr', 'srcset') .should('contain', 'http') }) })
4.8.0
This PR
@jennifer-shehane I was able to fix a majority of the issues described here. As far as the debugging issue goes, the only way that I think this could be fixed is if there is some state that indicates that the tests have been opened in the debugger. Perhaps there could be an additional variable added to The debugger gif you posted also revealed another small issue, that the progress bar would go back to full when complete, which has been fixed. Fixed jitter effect: Removed error where XHR requests would default to default command timeout: Performance improvements: Current These changes: |
@JessicaSachs That issue is actually present on |
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.
Note: assertion timeout is not synced with command timeout, must fix before merge
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.
Once the timeout issue you mentioned is fixed, this looks good to me
I have removed the progress bars under each assertion so that there can just be one progress bar that is synchronized around the whole command. @bkucera and I decided that this progress bar should be displayed underneath the last assertion, but I was unable to find a way to accomplish this without a significant performance reduction. Therefore, the progress bar will be displayed underneath the top-level command as such: This is probably not the ideal solution, but I am unable to think of any better viable solution. |
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.
Pulled it and ran it. Looks good to me.
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.
LGTM. I've rerun this firefox failing test a lot now and it keeps failing, so not sure there's something to investigate there.
User facing changelog
Adds an animated progress bar indicating how close the running command is to timing out
Additional details
In order to implement these changes, two new fields were added to every
command
log object:timeout
andwallClockStartedAt
. These two fields are needed in order to know what the timeout is for a specific command (each command has different defaults and the ability to change the timeout throughoptions
), as well as how long the command has been running for when the progress bar is first displayed (displayed at different times based on number of tests in the file and arbitrary user clicks).How has the user experience changed?
Here is an example of the progress bar when a command times out:
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?