Ionic e2e tests – scroll to your goal

Another slightly niche tip on end-to-end testing with the latest Ionic – 4.x stable as of this post. Maybe it’s obvious to more seasoned JS testers, but I struggled to find all the info in one place to successfully implement a test that needs to scroll content in an Ionic app. (I would assume a similar approach will also work when using Protractor with any other modern Angular app.)

The specific scenario? You’ve got a ‘thing’ your test needs to click, but it’s a scroll / drag away. It might technically be in the viewport, but below something else, like Ionic’s tab bar. Seems like a relatively common occurrence, and one that should be simple to deal with in your test.

Continue reading