Guest User

Untitled

a guest
Oct 24th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public void ScrollUpFromCenterYToTopOfElement(string id)
  2. {
  3. _app.WaitForElement(id);
  4. var element = _app.Query(e => e.Id(id)).First().Rect;
  5. DragFromElementCenterToDestination(element, element.CenterX, element.Y);
  6. }
  7.  
  8. public void ScrollDownFromCenterYToBottomOfElement(string id)
  9. {
  10. _app.WaitForElement(id);
  11. var element = _app.Query(e => e.Id(id)).First().Rect;
  12. var bottomOfElement = element.Y + element.Height;
  13. DragFromElementCenterToDestination(element, element.CenterX, bottomOfElement);
  14. }
  15.  
  16. private void DragFromElementCenterToDestination(AppRect rect, float destinationX, float destinationY)
  17. {
  18. _app.DragCoordinates(
  19. rect.CenterX,
  20. rect.CenterY,
  21. destinationX,
  22. destinationY
  23. );
  24. }
Add Comment
Please, Sign In to add comment