I'm writing a web application which contains a kind of schedule. After a certain action, the schedule is updated and when the user visits the page that day something happens.
Any ideas how to write a functional (acceptance) test for that kind of functionality?
I'm writing these end-to-end tests using Selenium. The only idea I have is the possibility to force the server to use a given date by visiting a URL like /set-fixed-time?time=...
, then after the test visit /set-real-time
.
On the server, I would use a custom object to get the current time and that object would be swapped when one of the URLs is visited.
i think its ok for developer testing however acceptance testing should be done without mock(you could have bug in your mock code). if its has to wait 3 days than acceptance test should wait those tree days or they could by-passed it by changing server time. i think its bad idea to leave back-doors just for testing(some tester could test it by hand and than forget to /set-real-time).