swifter icon indicating copy to clipboard operation
swifter copied to clipboard

Feature Request: Delay

Open Macarse opened this issue 6 years ago • 1 comments

I am using swifter for iOS UI testing. My tests setup swifter and with the help of JSON mocked responses I test the UI.

Swifter has been working great but I am missing some kind of delay setup for responses. The use case is: I want to test that a loading screen is shown while we wait for the response.

Right now I am using:

let response: ((HttpRequest) -> HttpResponse) = { req in
            return HttpResponse.ok(.custom("", {_ -> String in
                sleep(100000)
                return ""
            }))
        }

server.GET["path"] = response

What do you think?

Macarse avatar Jan 28 '19 21:01 Macarse

+1 for this feature request. Right now we are using the above suggestion by @Macarse 👍🏽

aataraxiaa avatar Dec 07 '20 16:12 aataraxiaa