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

Swipe Action Doesn't Work on RN ListView? #103

Closed
aarongreenwald opened this issue Mar 30, 2017 · 6 comments
Closed

Swipe Action Doesn't Work on RN ListView? #103

aarongreenwald opened this issue Mar 30, 2017 · 6 comments
Assignees

Comments

@aarongreenwald
Copy link
Contributor

See this commit - the test in question fails because it doesn't execute the swipe. Or at least I don't see it happen in the simulator when I'm running locally.

The test output:

1) sanity e2e should see more messages after scrolling:
     Error: Cannot find UI Element.
Exception with Assertion: {
  "Assert Criteria" : "assertWithMatcher: matcherForSufficientlyVisible(>=0.750000)",
  "Element Matcher" : "(((respondsToSelector(accessibilityIdentifier) && accessibilityID('0')) && !kindOfClass('RCTScrollView')) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((respondsToSelector(accessibilityIdentifier) && accessibilityID('0')) && kindOfClass('RCTScrollView'))))))",
  "Recovery Suggestion" : "Check if element exists in the UI, modify assert criteria, or adjust the matcher"
}

Error Trace: [
  {
    "Description" : "Interaction cannot continue because the desired element was not found.",
    "Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
    "Code" : "0",
    "File Name" : "GREYElementInteraction.m",
    "Function Name" : "-[GREYElementInteraction matchedElementsWithTimeout:error:]",
    "Line" : "142"
  }
]

When I had it as a simple scrollview in the source, not a listview, the swipe worked.

@LeoNatan
Copy link
Contributor

LeoNatan commented Jun 6, 2017

Does this still reproduce on modern RN and Detox?

@L0wry
Copy link

L0wry commented Sep 13, 2017

Hey guys,

Like to report that this still replicates.
My component is looking something like this

 render() {
    if (this.props.data.loading) {
      return (
        <View style={styles.Container}>
          <ActivityIndicator size={"large"} />
        </View>
      );
    }

    this.state = {
      dataSource: ds.cloneWithRows(
        ArticlePage.prepareDataForListView(this.props)
      )
    };
    return (
      <View testID='articleWrapper' style={styles.PageWrapper}>
        <ListView
          testID="listView"
          dataSource={this.state.dataSource}
          renderRow={ArticlePage.renderRow}
          initialListSize={10}
          scrollRenderAheadDistance={10}
          pageSize={1}
        />
      </View>
    );
  }

If I attempt to use any of the detox actions involving a swipeView
such as
await element(by.id('scrollView')).swipe('down');

I am presented with

Cannot find UI element.
    Exception with Action: {
      "Action Name" : "Scroll To Bottom content edge",
      "Element Matcher" : "(((((kindOfClass('UIScrollView') || kindOfClass('UIWebView')) && (respondsToSelector(accessibilityIdentifier) && accessibilityID('listView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches((respondsToSelector(accessibilityIdentifier) && accessibilityID('listView')))))) && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((((kindOfClass('UIScrollView') || kindOfClass('UIWebView')) && (respondsToSelector(accessibilityIdentifier) && accessibilityID('listView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches((respondsToSelector(accessibilityIdentifier) && accessibilityID('listView')))))) && 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" : "121"
      }
    ]

      at Invoke._callee5$ (node_modules/detox/lib/client/actions/actions.js:74:52)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:337:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:96:21)
      at step (node_modules/detox/lib/client/actions/actions.js:1:836)
      at node_modules/detox/lib/client/actions/actions.js:1:1066
      at new Promise (node_modules/core-js/modules/es6.promise.js:177:7)
      at Invoke.<anonymous> (node_modules/detox/lib/client/actions/actions.js:1:747)
      at Invoke.handle (node_modules/detox/lib/client/actions/actions.js:77:229)
      at Client._callee9$ (node_modules/detox/lib/client/Client.js:59:26)

Let me know if I can be of any more help
"react-native": "0.42.3",
"detox": "5.1.3",

@L0wry
Copy link

L0wry commented Sep 13, 2017

just seen there are new versions of detox, will upgrade and get back to you!

@L0wry
Copy link

L0wry commented Sep 13, 2017

So this half works

The component scrolls but on the Warning overlay shown below.
Not sure if this is a detox issue or a react thing

screen shot 2017-09-13 at 16 50 56

continuing to investigate

@L0wry
Copy link

L0wry commented Sep 14, 2017

stick in a console.disableYellowBox = true; in your app and this works as expected

@LeoNatan
Copy link
Contributor

This issue seems like a duplicate of #85 which is supposed to be fixed in Earl Grey. Just to make sure, with the latest versions of Detox, do you still reproduce this when a yellow box is shown?

@LeoNatan LeoNatan closed this as completed Mar 7, 2018
@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants