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

Detox tests run so slow that element.tap() interpreted as a longPress() #818

Closed
OlivierFreyssinet-old opened this issue Jul 10, 2018 · 1 comment

Comments

@OlivierFreyssinet-old
Copy link

OlivierFreyssinet-old commented Jul 10, 2018

Description

Detox tests run very slowly on android emulator and it causes element.tap() to be interpreted as a longPress().

Because of this, a part of my tests can't pass even if manually, the same behavior works perfectly.
I'm running the tests on a production build, and the app itself is not that slow, at all.

To give you an idea of how slow it is: for instance, swiping in a ViewPagerAndroid takes up to 8s with Detox tests (it runs at like ~1fps) while it is perfectly smooth doing it manually.

I could change the delayLongPress to more than 3000ms but if I could avoid to do that just for the tests, it would be great.

Steps to Reproduce

It's quite simple actually
React native code:

<TouchableOpacity
    onPress={this.onPress().bind(this)}
    onLongPress={this.onLongPress.bind(this)}
    testID="123456789_PersonRow"
>

Detox code:

it('should have personRow for 123456789', async () => {
    await expect(element(by.id('123456789_PersonRow'))).toBeVisible();
})
it('should tap personRow for 123456789', async () => {
    await element(by.id('123456789_PersonRow')).tap();
})

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.7
  • React Native: 0.56.0
  • Node: 8.11.2
  • Device: Android 7.1.1
  • macOS: 10.13.5

Device and verbose Detox logs

detox verb ws send: {"type":"invoke","params":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAssertion"},"method":"assertMatcher","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"android.support.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["123456789_PersonRow"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForSufficientlyVisible","args":[]}}]},"messageId":5}
detox verb ws onMessage: {"type":"invokeResult","params":{"result":"(null)"},"messageId":5}
detox verb ws  
      ✓ should have personRow for 123456789
detox verb ws send: {"type":"invoke","params":{"target":{"type":"Class","value":"com.wix.detox.espresso.EspressoDetox"},"method":"perform","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"android.support.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["123456789_PersonRow"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"android.support.test.espresso.action.ViewActions"},"method":"click","args":[]}}]},"messageId":6}
detox verb ws onMessage: {"type":"invokeResult","params":{"result":"(null)"},"messageId":6}
detox verb ws  
      ✓ should tap personRow for 123456789 (2058ms)
@OlivierFreyssinet-old
Copy link
Author

Ok so quick update: I do no longer have this problem after removing one particular looped animation (a blinker).

@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

2 participants