-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat(device): refactor and enhance view hierarchy XML generation. #4565
Conversation
Fixed PR Fixed android tests fix(android): `device.getViewHierarchyXML` return value. Fixed tests once again fix curly brackets.
Jest's API is not good enough and causing test runs to fail on warnings for unused snapshots.
6d5910e
to
056bc77
Compare
endDocument() | ||
} | ||
|
||
writer.toString() |
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.
Are you sure that flush is not needed here?
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.
good point, it does has flush()
method since it inherits from Write
(flush
is abstract
), but it means nothing this case since it immediately writes to an in-memory resource (the string), so there's nothing to flush
serializer.endTag("", view.javaClass.simpleName) | ||
} | ||
|
||
private fun serializeViewAttributes( |
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.
Wow. Great utilization of kotlin syntax
getViewHierarchyXml
ability to inject test-IDs while traversing the tree. This injection is a side-effect of the generation process to optimize performance.getViewHierarchyXml
togenerateViewHierarchyXml(shouldInjectTestIds = false)
to accurately represent the method's functionality.