JavaScript Redirects - Instructions
Click a button and a timed event will show a message and some will redirect you to a new page.
Buttons
Each button will redirect you to the same page, but the time taken to redirect will be different.
- 5 seconds
- 2 seconds
- a 4 seconds countdown button (does not redirect)
The countdown only button will show a message after the 4 seconds is over but not redirect.
Testing
How would you test this?
- What time boundary is acceptable after countdown completes to redirect?
- How would you time it?
Automating
Automating this for a redirect is pretty simple, click the button, check the redirect.
- Should you check the count down timer?
- Should you assert on the messages displayed?
- How much leeway do you give to the timing?
When automating the countdown only, you should certainly check the message.