-
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
Fix Object{N} + options mutation + command display names + big array/object message #5762
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
996f886
to
50458fc
Compare
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.
Thanks so much for this large amount of work! 💯
Overall, we'll need to discuss the visual changes to the reporter with the engineering team. I think a lot of this is in the right direction, especially with
- cloning the options object
- displaying the full options (the
cy.request()
with all its options printed actually looks really nice). - splitting out the
message
from theoptions
for the reporter. @chrisbreiding and I have been doing some work on splitting up the portions of the messaging from commands for the work in Improve Test Runner error experience #3762
I do have some thoughts on changes though:
- We do have a subset of
reporter
tests that are small, but growing. This would be an ideal place to test the new option displays. They're not super intuitive, and require some mock data, so ask if you are stuck somewhere. We'd love to have the visual changes tested. ✅- Here is an example: https://github.com/cypress-io/cypress/blob/develop/packages/reporter/cypress/integration/suites_spec.js
- Here are instructions to run them: https://github.com/cypress-io/cypress/blob/develop/packages/reporter/README.md#L65:L65
- I think splitting up the commands into separate words is not the right direction.
- Going from
SCROLLINTOVIEW
toSCROLL INTO VIEW
, I don't know, it takes up more space and doesn't look much more visually appealing. It also make the words return at smaller sizes (see screenshot). - Perhaps we should not do ALLCAPS for these, so that they reflect the way the actual command was called instead of splitting up the words, so instead of
SCROLLINTOVIEW
havescrollIntoView
. I think this should be as simple as removing this line of css: https://github.com/cypress-io/cypress/blob/develop/packages/reporter/src/commands/commands.scss#L202:L202 , so it may be quick to see what it looks like.
- Going from
- I threw together some random commands with options. The
.type()
command (as shown in screenshot below) shows the options in both themessage
and in theoptions
now. - I think the options styling in the reporter could use some work. They text is too tiny, making it hard to read.
Before
After
a8eb960
to
ea05170
Compare
@jennifer-shehane It didn't show options because I didn't run
|
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.
Hello again @sainthkh I ran by the UI with some of the team and have some feedback.
- Let's go back to the all caps styling. We are good with the
.SROLL INTO VIEW
, but would like it to not create a new line as in the case pictured and instead push the command further out.
- The options styling is better with the newer larger slightly darker font, so is 👌
- I was also asked to see what happens if someone has an extraordinary large amount of data in the options object. We do not appear to be doing any sort of truncation on this and would likely want to handle this situation better. Even if it's some really large character limit, it'd be better than none.
3 things have been changed.
Everything is in this screenshot: |
Fixed conflicts. |
Another interesting issue concerning display of very large output. #5929 |
@sainthkh We were thinking the display of the object might be nice displayed as expandable, similar to how the new 'configuration' tab handles objects in the Desktop-GUI. See this PR: #5068 I wonder if it could use the same components. If you consider this outside of the scope of this PR, that's alright too. We're not sure about the scrollbar in general though. Also, have you ever considered applying for a position here? You can apply online: https://cypress.io/jobs/ |
My actual goal was to finish out-of-the-box typescript support and cypress init and apply for the job. But it seems that the chance came early. Thanks. As it's Friday now, I'll apply for the position next week. |
Super, we are glad to hear this
…Sent from my iPhone
On Dec 13, 2019, at 07:23, Kukhyeon Heo ***@***.***> wrote:
@jennifer-shehane
I think #5929 should be added to this PR. I'll fix it tomorrow.
I think we need to decide after seeing it work in that way. I am not so sure about this. I'm worrying if it would make things too complicated. I'll try tomorrow.
Actually, that's what I wanted to do. But I have very mediocre career as a developer. So, my resume isn't persuasive enough. That's why I've been doing these.
My actual goal was to finish out-of-the-box typescript support and cypress init and apply for the job.
But it seems that the chance came early. Thanks. As it's Friday now, I'll apply for the position next week.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
1. The cause of #5929 was Cypress trying to create a string representation of an object. In the test case, Cypress was trying to make the string: Processing that long string caused the freeze. And it is solved by showing '...more' message when an array or object is too big. Big here means to have more than 10 items. Maybe, we need to discuss 10 is the right number. Before: Endless array/object. After: Show 2. Added react-inspector component to show the options. I think it looks better than stringified object. 3. We might need to do similar thing to the The problem is: Should we use react-inspector for 4. I sent my application. |
Closing because things have changed a lot. |
Closes command args are not displayed in the Command Log when options also passed into command #485=> feat: Show options with Collapsible #7716Closes cy commands with options object should not display as Object{N} in the Command Log #678=> feat: Show options with Collapsible #7716Closes Clone command options before passing into commands #3171=> User-provided options immutability. #6459Closes Reporter message improvements #5773=> Improve command name readability. #7527User facing changelog
cy
commands.options
object so that they're not mutated by thecy
commands.Additional details
Why was this change necessary?
Object{N}
message when they pass options. like below:options
value has been changed after calling commands. It is unintended.What is affected by this change?
Check changes below.
Any implementation details to explain?
CommandModel
. And it is rendered byMessage
component.options
are used to call the user-providedoptions
. Andopts
are options filled with default values.displayName
to functions.How has the user experience changed?
Issue #485
Before:
After:
Issue #678
Before:
After:
Issue #3171
Before: Test above failed.
After: It passes.
Issue #5773
Before:
After:
Issue #5929
Before:
Endless array/object.
After:
Show
...more
when an array or object is too big.PR Tasks
cypress-documentation
?options
but it is not documented.options
option and explanation toCypress.log()
page.type definitions
?cypress.schema.json
?