theappbusiness / TABTestKit

Library designed to make writing and maintaining automated tests for iOS applications. This includes automation of bio-metrics and controlling of mock servers
MIT License
59 stars 13 forks source link

Support pull to refresh (idea) #133

Closed itsmathou closed 3 years ago

itsmathou commented 4 years ago

Hey y'all

As we were writing some tests with a pull to refresh action, I was wondering if TABTestKit could support it? It could be implemented as follow

func pullToRefresh(from element: Element) {
     let firstElement = element.underlyingXCUIElement
     let start = firstElement.coordinateWithNormalizedOffset(CGVectorMake(0, 0))
     let finish = firstElement.coordinateWithNormalizedOffset(CGVectorMake(0, 6))
     start.pressForDuration(0, thenDragToCoordinate: finish)
}

This is just an idea as it could be useful for other people using the library 😄

roger-tan commented 4 years ago

That's probably a great feature to have it as it could be common action to do on a lot of apps.

zacoid55 commented 4 years ago

I'm pretty sure we have it in there already 🙂. Let me find you the test

roger-tan commented 4 years ago

@itsmathou Have you considered to use Refreshable protocol? We released on the last release v.1.7.0

This an example that you could find here

Let know us if it works on your side.

itsmathou commented 4 years ago

Hey @roger-tan & @zacoid55, thanks for the heads up! It works well :) Just need to be able to use 1.7.0 because of the requirement (sorry for the delay, got a bit busy) You can close!

roger-tan commented 3 years ago

Thank you for responding. I will close this issue.