From c1b740031d20684228e07f406f2ab39dce3254f2 Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Thu, 9 Jan 2025 17:24:47 +0800 Subject: [PATCH 1/2] MDL-84101 message: Behat test for managing notification options --- .../message_manage_notification_preferences.feature | 11 +++++++++++ message/tests/behat/message_preferences.feature | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/message/tests/behat/message_manage_notification_preferences.feature b/message/tests/behat/message_manage_notification_preferences.feature index c60d12a4998..3fdb969e644 100644 --- a/message/tests/behat/message_manage_notification_preferences.feature +++ b/message/tests/behat/message_manage_notification_preferences.feature @@ -215,3 +215,14 @@ Feature: Manage notification preferences - Email And I open the notification popover # Confirm the submission notification is NOT visible. And I should not see "You have submitted your assignment submission for Test assignment name" in the "#nav-notification-popover-container" "css_element" + + Scenario: Toggle notification preferences hides/displays options + Given I log in as "admin" + When I follow "Preferences" in the user menu + And I click on "Notification preferences" "link" in the "#page-content" "css_element" + Then I should see "Subscribed forum posts" + And I navigate to "Messaging > Notification settings" in site administration + And I click on "Subscribed forum posts" "checkbox" + And I follow "Preferences" in the user menu + And I click on "Notification preferences" "link" in the "#page-content" "css_element" + And I should not see "Subscribed forum posts" diff --git a/message/tests/behat/message_preferences.feature b/message/tests/behat/message_preferences.feature index b7df3ba9129..185a012e64b 100644 --- a/message/tests/behat/message_preferences.feature +++ b/message/tests/behat/message_preferences.feature @@ -27,3 +27,15 @@ Feature: To be able to see and save user message preferences as admin And I follow "Preferences" in the user menu And I click on "Message preferences" "link" And the field "Email" matches value "0" + + Scenario: Only active plugins have corresponding columns on the User preferences notification settings + # Needed for Mobile column to appear on User preferences notification settings. + Given the following config values are set as admin: + | airnotifieraccesskey | test123 | + And I log in as "admin" + And I follow "Preferences" in the user menu + When I click on "Notification preferences" "link" in the "#page-content" "css_element" + # By default, web/popup is enabled. mobile/airnotifier is enabled using an earlier step while email is disabled. + 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 From 3e72128eda5180999691f102a0f65adf974b47a9 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 23 Jan 2025 07:26:16 +0800 Subject: [PATCH 2/2] MDL-84101 behat: add step to save changes Signed-off-by: Simey Lameze --- .../tests/behat/message_manage_notification_preferences.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/message/tests/behat/message_manage_notification_preferences.feature b/message/tests/behat/message_manage_notification_preferences.feature index 3fdb969e644..ffbda7bb8c2 100644 --- a/message/tests/behat/message_manage_notification_preferences.feature +++ b/message/tests/behat/message_manage_notification_preferences.feature @@ -223,6 +223,7 @@ Feature: Manage notification preferences - Email Then I should see "Subscribed forum posts" And I navigate to "Messaging > Notification settings" in site administration And I click on "Subscribed forum posts" "checkbox" + And I click on "Save changes" "button" And I follow "Preferences" in the user menu And I click on "Notification preferences" "link" in the "#page-content" "css_element" And I should not see "Subscribed forum posts"