From aa6409c887a843261c80bcdff4b45220719ce623 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 29 Jan 2015 17:42:45 +0800 Subject: [PATCH] MDL-48933 core_message: Behat tests to cover messenger dialogs --- message/tests/behat/send_message.feature | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 message/tests/behat/send_message.feature diff --git a/message/tests/behat/send_message.feature b/message/tests/behat/send_message.feature new file mode 100644 index 00000000000..cba7edca3ff --- /dev/null +++ b/message/tests/behat/send_message.feature @@ -0,0 +1,53 @@ +@core @core_message +Feature: Users can send messages to each other + In order to communicate with another user + As a user + I can send private messages + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | user1 | User | One | one@asd.com | + | user2 | User | Two | two@asd.com | + + @javascript + Scenario: Using the 'Send message' dialog on one's profile + Given I log in as "admin" + And I set the following administration settings values: + | forceloginforprofiles | 0 | + And I log out + And I log in as "user1" + And I navigate to "Messages" node in "My profile" + And I set the field "Search people and messages" to "User Two" + And I press "Search people and messages" + And I follow "Picture of User Two" + When I follow "Send a message" + And I set the field "Message to send" to "Lorem ipsum sa messagus textus" + And I press "Send message" + And I navigate to "Messages" node in "My profile" + And I set the field "Search people and messages" to "User Two" + And I press "Search people and messages" + And I follow "Send message to User Two" + Then I should see "Lorem ipsum sa messagus textus" + + @javascript + Scenario: Using the 'Send message' dialog on one's course profile + Given the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | user1 | C1 | student | + | user2 | C1 | student | + And I log in as "user1" + And I follow "Course 1" + And I follow "Participants" + And I follow "User Two" + When I follow "Send a message" + And I set the field "Message to send" to "Lorem ipsum sa messagus textus" + And I press "Send message" + And I navigate to "Messages" node in "My profile" + And I set the field "Search people and messages" to "User Two" + And I press "Search people and messages" + And I follow "Send message to User Two" + Then I should see "Lorem ipsum sa messagus textus"