Setup
Set the following in your config.php:
$CFG->sessiontimeout = 60;
$CFG->sessiontimeoutwarning = 40;
Notes
- Familiarize yourself with the two modals.
- There is not much time between the steps in this test and if you wait too long before Extending the session, you may logged out
- You may want a clock handy so that you know you've waited long enough.
Case 1
This test requires you to wait 20 seconds which is the value of the first warning time (sessiontimeout - sessiontimeoutwarning). Plus 10 secods to validate session.
The idea is to test that you are shown the extend dialogue after 20 seconds, and that you extend the session. Waiting a
further 10-15 seconds confirms that the session was extended but without causing the extend dialogue to be shown for a second time.
- Log in as a student
- Wait ~20 seconds
- Confirm that the "No recent activity" modal appears
- Click on the "Extend session" button
- Confirm that the modal closes
- Wait a further ~10 seconds
- Navigate to another page in Moodle
- Confirm that you had not been logged out
Case 2
This test requires you to wait 20 + 40 seconds which is the value of the sessiontimeout.
The idea is to test that you are shown the extend dialogue after 20 seconds, and you cancel the warning. Session expired dialogue is shown after ~40 seconds of extend dialogue.
- Log in as a student
- Wait ~20 seconds
- Confirm that the "No recent activity" modal appears
- Click on the "Cancel" button
- Confirm that the modal closes
- Wait further ~40 seconds
- Confirm that the "Session expired" modal appears
Case 3
This test requires you to wait 20 + 40 seconds which is the value of the sessiontimeout.
The idea is to test that you are shown the extend dialogue after 20 seconds, and there is no interactions. Session expired dialogue is shown after ~40 seconds of extend dialogue.
- Log in as a student
- Wait ~20 seconds
- Confirm that the "No recent activity" modal appears
- Wait further ~40 seconds
- Confirm that the "No recent activity" modal disappears
- Confirm that the "Session expired" modal appears
Case 4
This test requires you to wait 20 + 40 seconds which is the value of the sessiontimeout.
The idea is to test that you are shown the Session expired dialogue, and you are redirected to login page.
- Log in as a student
- Wait ~20 seconds
- Confirm that the "No recent activity" modal appears
- Wait further ~40 seconds
- Confirm that the "No recent activity" modal disappears
- Confirm that the "Session expired" modal appears
- Click on the "Login again" button
- Confirm that you are redirected to login page
Case 5
This test requires you to wait 20 + 40 seconds which is the value of the sessiontimeout.
The idea is to test that you are shown the Session expired dialogue, and you are redirected to login page automatically by interacting to any page within moodle.
- Log in as a student
- Wait ~20 seconds
- Confirm that the "No recent activity" modal appears
- Wait further ~40 seconds
- Confirm that the "No recent activity" modal disappears
- Confirm that the "Session expired" modal appears
- Navigate to page within Moodle
- Confirm that you are redirected to login page
Case 6
This test requires you to wait 20 seconds which is the value of the sessiontimeout.
The idea is to test that you are shown the extend dialogue after 20 seconds in more than one tabs, and you extend the session in one tab, it should reflect in other tabs.
- Log in as a student - tab A
- Navigate to another page within Moodle in new tab B
- Wait ~20 seconds
- Confirm that the "No recent activity" modal appears all tabs
- Click on the "Extend session" button in tab A
- Confirm that the "No recent activity" modal disappears in tab A
- Confirm that the "No recent activity" modal disappears in tab B in next ~40 seconds
- Navigate to page within Moodle in both tabs
- Confirm that you had not been logged out