From c8b4b67a2fc9599690deef5bb67a4aa15b8df5c2 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 23 Apr 2015 14:05:55 +0800 Subject: [PATCH] MDL-49960 message: Adding behat test for recent conversations --- .../tests/behat/recent_conversations.feature | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 message/tests/behat/recent_conversations.feature diff --git a/message/tests/behat/recent_conversations.feature b/message/tests/behat/recent_conversations.feature new file mode 100644 index 00000000000..6ba4ff3e513 --- /dev/null +++ b/message/tests/behat/recent_conversations.feature @@ -0,0 +1,36 @@ +@core @core_message @javascript +Feature: Recent conversations contains my recent conversations + In order to view my recent conversations + As a user + I have the option to filter messages by recent conversations + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | user1 | User | One | one@example.com | + | user2 | User | Two | two@example.com | + | user3 | User | Three | three@example.com | + + Scenario: View that I don't have recent conversations + Given I log in as "user1" + And I follow "Messages" in the user menu + When I set the field "Message navigation:" to "Recent conversations" + Then I should not see "User Two" + And I should not see "User Three" + + Scenario: View my recent conversations + Given I log in as "user1" + And I send "Message from user1 to user2" message to "User Two" user + And I send "Message from user1 to user3" message to "User Three" user + And I follow "Messages" in the user menu + When I set the field "Message navigation:" to "Recent conversations" + Then I should see "User Two" + And I should see "User Three" + And I should see "Message from user1 to user2" + And I should see "Message from user1 to user3" + And I log out + And I log in as "user2" + And I follow "Messages" in the user menu + And I set the field "Message navigation:" to "Recent conversations" + And I should see "Message from user1 to user2" + And I should not see "Message from user1 to user3"