-
Functional Test
-
Minor
-
Moodle 3.10
Note:
This test requires a site where notifications/emails are enabled. For this reason it is not possible to use the QA testing site.
The test needs a course with a teacher and two students enrolled.
The test site needs to have event monitoring enabled: site administration > reports > event monitoring rules > enable
- Log in as a teacher and go to a course where you have editing rights.
- Upload a file resource and name it 'Course contract'.
- Go to Course administration > Reports > Event monitoring rules and create a new rule named Contract, "Area to monitor" = File and Select an event =course module viewed. Choose your own description, frequency and notification message template.
- Go to User menu > preferences > Event monitoring and select the course. Subscribe to the rule you made, selecting 'Course contract' from the dropdown.
- Navigate to User menu > preferences > Notification preferences and verify email is "on" for both online and offline Event monitor subscriptions.
- Log in to the course as a student1 and click to download the file resource.
- Run cron (if it isn't automatically running)
- Verify that you receive an email to the teacher's email address with the name of the Event as the subject of the email and the notification message as the body of the email.
- Log in as a teacher and return to User menu > preferences > Notification preferences. Turn "off" email and turn "on" the web notifications for "Notifications of rule subscriptions".
- Log in as student2 and click to download the file resource.
- Run cron (if it isn't automatically running)
- Verify you receive a notification in the notification popover in the nav bar.
- Verify that you do not receive an email for that notification