Addition of Pager View breaks scrolling with Maestro on iOS

119 views Asked by At

I'm seeing a total failure of our Maestro tests because of the recent addition of a carousel/pager on the home screen - Maestro seems unable to scroll at all, either by scroll or scrollUntilVisible, with the carousel present. Since it's at the top of a long page, this breaks most of our tests.

Details:

  • This is only occurring on iOS; Android runs fine.
  • We're using React Native, and a package, react-native-pager-view, which relies on UIPageViewController, for the carousel/pager.
  • If I comment out the carousel, all works as expected.

Does anyone have any idea why this might be happening, or a workaround? Or, failing that, some way to move the page down beyond the carousel without using scroll or scrollUntilVisible? (I looked at travel, but not sure if that could be used for this.) If I manually scroll the emulator past it and then run scroll in Maestro Studio, it works again, so any way of getting the page past the carousel would probably work.

1

There are 1 answers

0
Andrew On BEST ANSWER

Turns out the issue seems to be that react-native-pager-view's implementation of UIPageViewController doesn't seem to play nice with Maestro's scroll and scrollUntilVisible commands.

Instead, use swipe to swipe past the element, then scrollUntilVisible will work fine.

- runFlow:
    when:
      platform: iOS
    commands: 
    - swipe:
      start: 50%, 75%
      end: 50%, 55%
  • Note: Turns out this isn't Maestro-specific; the pager breaks scrolling on actual iOS devices too. (Surprise surprise - when Maestro says you have a bug, you actually do.) So rather than using this workaround, you might wish to use a different pager implementation, or just go with a Flatlist.