MDL-84102 message: Behat for setting default notification preferences

This commit is contained in:
Angelia Dela Cruz
2025-02-12 15:24:36 +08:00
parent cd6600da14
commit c1c60e69dc
@@ -39,3 +39,35 @@ Feature: To be able to see and save user message preferences as admin
Then "[data-processor-name='popup']" "css_element" should exist
And "[data-processor-name='email']" "css_element" should not exist
And "[data-processor-name='airnotifier']" "css_element" should exist
@javascript
Scenario: An admin can set the default notification preferences
Given I log in as "admin"
And I navigate to "Messaging > Notification settings" in site administration
And I set the field "email" to "1"
And I press "Save changes"
And I set the following fields to these values:
| mod_assign_assign_notification_enabled[popup] | 1 |
| mod_assign_assign_notification_enabled[email] | 0 |
| mod_feedback_submission_enabled[popup] | 0 |
| mod_feedback_submission_locked[popup] | 1 |
| mod_feedback_submission_enabled[email] | 1 |
| mod_feedback_submission_locked[email] | 1 |
| mod_feedback_message_disable | 0 |
And I press "Save changes"
And I log in as "student1"
And I follow "Preferences" in the user menu
When I click on "Notification preferences" "link" in the "#page-content" "css_element"
# Assignment web notification is enabled, email is disabled.
Then the field "message_provider_mod_assign_assign_notification_popup" matches value "1"
And the field "message_provider_mod_assign_assign_notification_email" matches value "0"
# Corresponding checkboxes can be updated.
And I click on "message_provider_mod_assign_assign_notification_popup" "checkbox"
And I click on "message_provider_mod_assign_assign_notification_email" "checkbox"
And the field "message_provider_mod_assign_assign_notification_popup" matches value "0"
And the field "message_provider_mod_assign_assign_notification_email" matches value "1"
# Feedback submission notifications are locked off for web and locked on for email.
And "Feedback notifications" row "Web" column of "preference-table" table should contain "Locked off"
And "Feedback notifications" row "Requires configuration Email" column of "preference-table" table should contain "Locked on"
# Feedback reminder is disabled.
And I should not see "Feedback reminder"