Closed dagumak closed 8 years ago
This is not possible. What is your objective with this? It sounds to me like your trying to test several things at once?
@Crevil the objective its to test a polling service which would only stop polling when the status reaches success or failure. What suggestions do you have for testing a polling service?
I would test the polling action in one test and see that it requests the same endpoint several times. Next up I would make sure it stopped polling on a specific response. This success scenario does not need to test the polling mechanism again, as you already tested this.
Otherwise you could hack something with the dynamics mock APIs, something along returning one mock. After some delay push in a new response. But this relies on the time aspect of execution, which I don't like.
Further more, I expect you to be e2e testing your application. This is, to me, more of a unit test, no?
@Crevil Fair point, and solid advice. Yes, I am also running an e2e test for it.
Thank you
For example, I have an application that polls for changes. Is it possible to give a set of responses for it to return in sequence?