moodle/message/tests/behat/delete_messages.feature
Sara Arjona f7dfa9ba3e MDL-63214 message: Add privacy preferences to filter who can message
Add new messaging profile preferences to allow users to choose who
can message them:
- By default, users can select between 'My contacts only' and 'My
contacts and anyone in my courses'
- When $CFG->messagingallusers is enabled, a new option is displayed
also: 'Anyone on the site'. For users who have selected this option,
if $CFG->messagingallusers is disabled, the behaviour will be changed
to 'My contacts and anyone in my courses'
2018-10-17 11:52:57 +02:00

38 lines
2 KiB
Gherkin

@core @message @javascript
Feature: Delete messages
In order to communicate with fellow users
As a user
I need to be able to delete messages
Scenario: Delete messages
Given the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | 1 | user1@example.com |
| user2 | User | 2 | user2@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | student |
| user2 | C1 | student |
And I log in as "user2"
And I send "User 2 to User 1 message 1" message to "User 1" user
And I send "User 2 to User 1 message 2" message in the message area
And I send "User 2 to User 1 message 3" message in the message area
And I log out
When I log in as "user1"
And I follow "Messages" in the user menu
And I click on "start-delete-messages" "message_area_action"
And I click on "User 2 to User 1 message 1" "text" in the "messages" "message_area_region"
And I click on "User 2 to User 1 message 2" "text" in the "messages" "message_area_region"
And I click on "Delete selected messages" "button"
# Confirm the interface is immediately updated.
Then I should see "User 2 to User 1 message 3" in the "messages" "message_area_region"
And I should not see "User 2 to User 1 message 2" in the "messages" "message_area_region"
And I should not see "User 2 to User 1 message 1" in the "messages" "message_area_region"
# Confirm that the changes are persisted.
And I reload the page
And I should see "User 2 to User 1 message 3" in the "messages" "message_area_region"
And I should not see "User 2 to User 1 message 2" in the "messages" "message_area_region"
And I should not see "User 2 to User 1 message 1" in the "messages" "message_area_region"