diff --git a/message/tests/behat/behat_message.php b/message/tests/behat/behat_message.php index 577da7cb366..144983ad049 100644 --- a/message/tests/behat/behat_message.php +++ b/message/tests/behat/behat_message.php @@ -51,8 +51,11 @@ class behat_message extends behat_base { $steps = array(); $steps[] = new Given('I am on homepage'); - - $steps[] = new Given('I navigate to "' . get_string('messages', 'message') . '" node in "' . get_string('myprofile') . '"'); + if ($this->running_javascript()) { + $steps[] = new Given('I follow "' . get_string('messages', 'message') . '" in the user menu'); + } else { + $steps[] = new Given('I follow "' . get_string('messages', 'message') . '"'); + } $steps[] = new Given('I set the field "' . get_string('searchcombined', 'message') . '" to "' . $this->escape($userfullname) . '"'); $steps[] = new Given('I press "' . get_string('searchcombined', 'message') . '"'); diff --git a/message/tests/behat/block_users.feature b/message/tests/behat/block_users.feature index dac1cc679be..a975701da8c 100644 --- a/message/tests/behat/block_users.feature +++ b/message/tests/behat/block_users.feature @@ -11,7 +11,7 @@ Feature: Block users from contacting me | user1 | User | One | one@asd.com | | user2 | User | Two | two@asd.com | And I log in as "user1" - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu And I set the field "Search people and messages" to "User Two" And I press "Search people and messages" When I click on "Block contact" "link" in the "User Two" "table_row" @@ -20,7 +20,7 @@ Feature: Block users from contacting me And I should see "User Two" And I log out And I log in as "user2" - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu And I set the field "Search people and messages" to "User One" And I press "Search people and messages" And I follow "Send message to User One" diff --git a/message/tests/behat/display_history.feature b/message/tests/behat/display_history.feature index 87b60120f18..b1a49761f62 100644 --- a/message/tests/behat/display_history.feature +++ b/message/tests/behat/display_history.feature @@ -1,4 +1,4 @@ -@core @core_message +@core @core_message @javascript Feature: Message history displays correctly In order to read messages between two users As a user @@ -22,7 +22,7 @@ Feature: Message history displays correctly And I send "Message 10 from user1 to user2" message to "User Two" user Scenario: View sent messages - When I navigate to "Messages" node in "My profile" + When I follow "Messages" in the user menu And I set the field "Search people and messages" to "User Two" And I press "Search people and messages" And I click on "Message history" "link" in the "User Two" "table_row" @@ -37,7 +37,7 @@ Feature: Message history displays correctly Scenario: View received messages When I log out And I log in as "user2" - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu And I follow "User One (10)" # Should show all of the user's unread messages. Then I should see "Message 1 from user1 to user2" diff --git a/message/tests/behat/manage_contacts.feature b/message/tests/behat/manage_contacts.feature index 801e5aa2b52..e2fe4955bd8 100644 --- a/message/tests/behat/manage_contacts.feature +++ b/message/tests/behat/manage_contacts.feature @@ -1,4 +1,4 @@ -@core @core_message +@core @core_message @javascrript Feature: Manage contacts In order to easily access the users I interact more with As a user @@ -12,7 +12,7 @@ Feature: Manage contacts And I log in as "user1" And I send "Message 1 from user1 to user2" message to "User Two" user And I send "Message 2 from user1 to user2" message to "User Two" user - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu And I set the field "Search people and messages" to "User Two" And I press "Search people and messages" When I click on "Add contact" "link" in the "User Two" "table_row" @@ -29,4 +29,4 @@ Feature: Manage contacts @javascript Scenario: Adding and removing contacts with Javascript enabled - Scenario: Adding and removing contacts with Javascript disabled +# Scenario: Adding and removing contacts with Javascript disabled diff --git a/message/tests/behat/message_participants.feature b/message/tests/behat/message_participants.feature index 4c151c6945a..3c3dce0f0d0 100644 --- a/message/tests/behat/message_participants.feature +++ b/message/tests/behat/message_participants.feature @@ -29,8 +29,7 @@ Feature: An user can message course participants | messagebody | Here it is, the message content | And I press "Preview" And I press "Send message" - And I follow "Home" - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu And I set the field "Message navigation:" to "Recent conversations" Then I should see "Here it is, the message content" And I should see "Student 1" diff --git a/message/tests/behat/search_history.feature b/message/tests/behat/search_history.feature index 66d74cc5fd7..02c51adad62 100644 --- a/message/tests/behat/search_history.feature +++ b/message/tests/behat/search_history.feature @@ -1,4 +1,4 @@ -@core @core_message +@core @core_message @javascript Feature: Users can search their message history In order to read old messages As a user @@ -11,7 +11,7 @@ Feature: Users can search their message history | user2 | User | Two | two@asd.com | And I log in as "user1" When I send "Give me your biscuits" message to "User Two" user - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu And I set the field "Search people and messages" to "your biscuits" And I press "Search people and messages" Then I should see "User Two" diff --git a/message/tests/behat/send_message.feature b/message/tests/behat/send_message.feature index 099c62dbc1e..ded2df7796b 100644 --- a/message/tests/behat/send_message.feature +++ b/message/tests/behat/send_message.feature @@ -15,15 +15,15 @@ Feature: Users can send messages to each other Given the following config values are set as admin: | forceloginforprofiles | 0 | And I log in as "user1" - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu 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" + When I press "Message" And I set the field "Message to send" to "Lorem ipsum sa messagus textus" And I press "Send message" And I am on homepage - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu 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" @@ -42,11 +42,10 @@ Feature: Users can send messages to each other And I follow "Course 1" And I follow "Participants" And I follow "User Two" - When I follow "Send a message" + When I press "Message" And I set the field "Message to send" to "Lorem ipsum sa messagus textus" And I press "Send message" - And I am on homepage - And I navigate to "Messages" node in "My profile" + And I follow "Messages" in the user menu 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"