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

RCTSegmentedControl not matchable #227

Closed
benadamstyles opened this issue Aug 14, 2017 · 5 comments
Closed

RCTSegmentedControl not matchable #227

benadamstyles opened this issue Aug 14, 2017 · 5 comments

Comments

@benadamstyles
Copy link

Description

element(by.type('RCTSegmentedControl')) returns the following error, but the element is there and visible:

Exception with Assertion: {
  "Assertion Criteria" : "assertWithMatcher:matcherForSufficientlyVisible(>=0.750000)",
  "Element Matcher" : "((kindOfClass('RCTSegmentedControl') && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches((kindOfClass('RCTSegmentedControl') && kindOfClass('RCTScrollView'))))))"
}

Error Trace: [
  {
    "Description" : "Assertion with matcher [M] failed: UI element [E] failed to match the following matcher(s): [S]",
    "Description Glossary" :     {
      "M" : "matcherForSufficientlyVisible(>=0.750000)",
      "E" : "<RCTSegmentedControl:0x7ff1e5462440; AX=N; AX.id='auth:code-or-name-switch'; AX.frame={{25, 321.5}, {270, 28}}; AX.activationPoint={160, 335.5}; AX.traits='UIAccessibilityTraitNone'; AX.focused='N'; frame={{25, 110.5}, {270, 28}}; alpha=1>",
      "S" : "matcherForSufficientlyVisible(>=0.750000)"
    },
    "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
    "Error Code" : "3",
    "File Name" : "GREYAssertions.m",
    "Function Name" : "+[GREYAssertions grey_createAssertionWithMatcher:]_block_invoke",
    "Line" : "75"
  }
]

Node, Device, Xcode and macOS Versions

  • Node: v7.8.0
  • Device: iPhoneSE Simulator
@isnifer
Copy link
Contributor

isnifer commented Aug 14, 2017

Why you didn't use element(by.id('auth:code-or-name-switch'))

@benadamstyles
Copy link
Author

@isnifer That also doesn't work, sorry I should have mentioned that. If you look at the source code for SegmentedControlIOS, it doesn't include the testID prop.

@isnifer
Copy link
Contributor

isnifer commented Aug 14, 2017

@Leeds-eBooks wow, I think you should create a PR for this into RN :)

@benadamstyles
Copy link
Author

Actually I'm wrong, it's imported in ViewPropTypes. In any case, setting testID still does not match.

@rotemmiz
Copy link
Member

Please provide the view hierarchy (you can find it in the device log after test fails)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants