fix for failing tests
more refined testing (find buttons for the current page, swipe to page)
long click buttons
clean up test code
Merged from upstream.