From 2196b091bd075a89ed4b449f295da31bc3317e4a Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Thu, 9 Jan 2025 17:24:47 +0800 Subject: [PATCH] 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 4c562f8e9cd..3234b4bc587 100644 --- a/message/tests/behat/message_manage_notification_preferences.feature +++ b/message/tests/behat/message_manage_notification_preferences.feature @@ -213,3 +213,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