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

expose a method that returns the hierarchy for a given element #76

Closed
doronpr opened this issue Jan 12, 2017 · 8 comments
Closed

expose a method that returns the hierarchy for a given element #76

doronpr opened this issue Jan 12, 2017 · 8 comments

Comments

@doronpr
Copy link
Contributor

doronpr commented Jan 12, 2017

Basically, we need the method to return GREYElementHierarchy for a given element which can be based on this code: 45a9c19#diff-6d470f1f5e297378206088228e32fd1cR17

JS Syntax should be something like this:
element(by.id('someId')).printHierarchy();

@LeoNatan
Copy link
Contributor

Doesn't the hierarchy inspector in Xcode give this information? Is it not enough?

@talkol
Copy link

talkol commented Jan 12, 2017

imagine a log in CI with this data.. cross platform for iOS and Android
I can see why it's useful

@LeoNatan
Copy link
Contributor

I don't see this being useful outside of debug. A hierarchy is often huge and ugly. Why would you fill the CI log with it? On error, it should be printed. But per test?

@doronpr
Copy link
Contributor Author

doronpr commented Jan 12, 2017

Yes. CI plus -

  1. You don't need to have Xcode open 😉
  2. You don't need to put breakpoint etc. (if I want to get the hierarchy at a certain point in time deep inside the test)

@doronpr
Copy link
Contributor Author

doronpr commented Jan 12, 2017

@LeoNatan I agree for the app level but hierarchy starting of a specific element down can be not so bad.

@rotemmiz
Copy link
Member

As I see it, we should not let the user use this function, but include a print of it if a test fails.
This should be a part of a set of artifacts that detox should output upon a failed test:

  1. video of the specific test
  2. device log
  3. hierarchy of that screen (On android there's an ability to extract .hierarchy.uix file, is there something similar in iOS?)

@LeoNatan
Copy link
Contributor

We already print on failure.

@LeoNatan
Copy link
Contributor

LeoNatan commented Jun 6, 2017

I don’t think this is needed. Detox is not a debugging tool. We already print the hierarchy in cases of failure, and we will improve the error messages to display a better information in the future.

@LeoNatan LeoNatan closed this as completed Jun 6, 2017
@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants