AutorÃa | Ultima modificación | Ver Log |
@core_message @message_popup @javascriptFeature: Notification popover unread notificationsIn order to be kept informedAs a userI am notified about relevant events in MoodleBackground:Given the following "users" exist:| username | firstname | lastname | email || student1 | Student | 1 | student1@example.com || student2 | Student | 2 | student2@example.com |# This should generate some notificationsAnd the following "notifications" exist:| subject | userfrom | userto | timecreated | timeread || Test 01 | student2 | student1 | 1654587996 | null || Test 02 | student2 | student1 | 1654587997 | null |Scenario: Notification popover shows correct unread countGiven I log in as "student1"# Confirm the popover is saying 1 unread notifications.And I should see "2" in the "#nav-notification-popover-container [data-region='count-container']" "css_element"# Open the popover.When I open the notification popover# Confirm the notifications are visible.Then I should see "Test 01" in the "#nav-notification-popover-container" "css_element"And I should see "Test 02" in the "#nav-notification-popover-container" "css_element"@_bug_phantomjsScenario: Clicking a notification marks it as readGiven I log in as "student1"# Open the notifications.When I open the notification popoverAnd I follow "Test 01"And I open the notification popoverAnd I follow "Test 02"# Confirm the count element is hidden (i.e. there are no unread notifications).Then "[data-region='count-container']" "css_element" in the "#nav-notification-popover-container" "css_element" should not be visibleScenario: Mark all notifications as readGiven I log in as "student1"When I open the notification popoverAnd I click on "Mark all as read" "link" in the "#nav-notification-popover-container" "css_element"# Refresh the page to make sure we send a new request for the unread count.And I reload the page# Confirm the count element is hidden (i.e. there are no unread notifications).Then "[data-region='count-container']" "css_element" in the "#nav-notification-popover-container" "css_element" should not be visible