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

Where is the output for the UI Hierarchy? #737

Closed
StefanWallin opened this issue May 16, 2018 · 5 comments
Closed

Where is the output for the UI Hierarchy? #737

StefanWallin opened this issue May 16, 2018 · 5 comments

Comments

@StefanWallin
Copy link

Description

When you write a test that can't find an element in a UI hierarchy, detox will output the following message mentioning that:

...Check if the element exists in the UI hierarchy printed below...

Error: Cannot find UI Element.
    Exception with Assertion: {
      "Assertion Criteria" : "assertWithMatcher:isNotNil",
      "Element Matcher" : "(((respondsToSelector(accessibilityIdentifier) && accessibilityID('testId')) && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((respondsToSelector(accessibilityIdentifier) && accessibilityID('testId')) && kindOfClass('RCTScrollView'))))))",
      "Recovery Suggestion" : "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element."
    }

    Error Trace: [
      {
        "Description" : "Interaction cannot continue because the desired element was not found.",
        "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
        "Error Code" : "0",
        "File Name" : "GREYElementInteraction.m",
        "Function Name" : "-[GREYElementInteraction matchedElementsWithTimeout:error:]",
        "Line" : "124"
      }
    ]
    at Client.execute (../node_modules/detox/src/client/Client.js:72:13)

No such output is generated. It would've been very helpful.

Steps to Reproduce

  1. Write a test with an expect matcher for a non-existing ID
  2. Run the detox tests

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.3
  • React Native: 0.52.1
  • Node: v9.0.0
  • Device: iPhone 7
  • Xcode: 9.3.1 (9E501)
  • macOS: 10.13.4

Device and verbose Detox logs

Not applicable

@LeoNatan
Copy link
Contributor

Hmm it used to be printed in the past. @rotemmiz ?

@stale
Copy link

stale bot commented Jul 2, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.

@stale stale bot added the 🏚 stale label Jul 2, 2018
@mloureiro
Copy link

@LeoNatan not sure if this used to work in the past, but is rather confusing.
I also ended up looking for this, so I would rather remove that than mentioning but not supporting, the latter kind of seems to be a bug

@stale stale bot removed the 🏚 stale label Jul 2, 2018
@LeoNatan
Copy link
Contributor

Fixed on master.

@LeoNatan
Copy link
Contributor

View hierarchy is now forwarded to the tester, which will include it in the failure reason for failing tests.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 24, 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

4 participants