Is there a way to control time so I can accelerate testing of time-based workflows?
I have a bunch of workflows that have an element of time.
For example, I send a proposal for approval, and it needs to be approved within 5 days. If it isn't approved in 3 days, I send them a daily reminder. If after 5 days it isn't approved, I look up the person's manager and send them the escalation request.
I want to be able to test these kind of workflows rapidly to see if the logic is working right (and ultimately automate testing for regression purposes).
I would like to be able to control time in system test so I can verify that the whole thing works end-to-end. It would go something like this
I have a bunch of workflows that have an element of time.
For example, I send a proposal for approval, and it needs to be approved within 5 days. If it isn't approved in 3 days, I send them a daily reminder. If after 5 days it isn't approved, I look up the person's manager and send them the escalation request.
I want to be able to test these kind of workflows rapidly to see if the logic is working right (and ultimately automate testing for regression purposes).
I would like to be able to control time in system test so I can verify that the whole thing works end-to-end. It would go something like this
- <start on day = 0>
- create workflow
- send for approval to X
- verify approval is pending X
- <advance to the next day: day = 1>
- verify approval is still pending X
- <advance to the next day: day = 2>
- verify the approval is still pending X
- <advance to the next day: day = 3>
- verify reminder is sent to X
- verify approval is still pending X
- <advance to the next day: day = 4>
- verify reminder is sent to X
- verify approval is still pending X
- <advance to the next day: day = 5>
- verify notification is sent to X telling them the issue has been escalated
- verify escalation is sent to X's manager
- etc.
Does anyone know of a good way to accomplish this? I want to be able to do this 5 day test in 5 minutes or 5 seconds.
This seems like the kind of thing that a lot of applications would want to do - I know I could use it in many places inside my application.
Thanks in advance for the help.
Jack