0

I have worked on a Slider component using React Native Slider. And now I want to test it by simulating the sliding gesture. But according to React Native Testing Library documentation, there are only three gestures which are:

  1. fireEvent.Press
  2. fireEvent.changeText
  3. fireEvent.scroll

Is there anyway to simulate the sliding gesture?

Muntha
  • 41
  • 1
  • 7

1 Answers1

1

If you want to stick with react native library component testing, try out:

fireEvent(el, 'rowOpen', eventData);
// or
fireEvent(el, 'onRowOpen', eventData);

Source

This functionality can also be achieved with either Appium or Detox, and would require starting up a simulator or physical device. Both of them, under-the-hood would be using the Native Espresso/XCUITest drivers to achieve this.

I suggest using Detox, or Appium controlled via WebDriverIO.

Mark Han
  • 2,785
  • 2
  • 16
  • 31