I am testing a web application. This is the scenario: An agent signs up by providing some details like email etc The agent then receives an email with a Registration link that expires after 15 days. My question is how can I test that the link expires after 15 days?
There could be more options, some that come to mind right now:
- The number of days should be an easily configurable number, definitely not a hard-coded value. It should be possible to change it with no need to release a new version of the application. Therefore you can test that the system is picking up different values. You can choose lower numbers for the tests.
- There might (likely) be a date information of when the link was generated. E.g. you generate the link and store it in a database along with the date(time) is was generated. You might be able to change it 15 (any other number of) days into the past and test it.
- There are containers that allow you to time-travel, if you google something like "time travel testing", you will find more information.
It all depends on what options you have on your projects/in your company. Some companies/projects will have only some of these options (or some other I don't know about). Points #1 and #2 should be possible almost everywhere (unless the company won't let you access the database etc. (only read permissions etc.)).
It is one of the typical time-bounded scenario that requires validation during signup testing. In this case, the 15 days wait period impacts the QA completion estimates.
The most feasible approach followed by the manual testing services to verify these time-bounded scenarios is to coordinate with the dev team and reduce the duration to 1-2 days on testing environments.
The significant check is to ensure, that the link gets expire after a particular interval of time. So, the results obtained with 1-2 days duration will be similar to the 15 days on production env.