forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-55926 message: add behat tests for message ui
- Loading branch information
1 parent
6a69cda
commit f05c101
Showing
10 changed files
with
251 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@core @message @javascript | ||
Feature: Delete all messages | ||
In order to communicate with fellow users | ||
As a user | ||
I need to be able to delete all messages | ||
|
||
Scenario: Delete all messages | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| user1 | User | 1 | user1@example.com | | ||
| user2 | User | 2 | user2@example.com | | ||
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 "Delete all" "button" | ||
# Confirm dialogue. | ||
And I click on "Yes" "button" | ||
# Confirm the interface is immediately updated. | ||
Then I should not see "User 2" in the "conversations" "message_area_region_content" | ||
# Confirm the changes are persisted. | ||
And I reload the page | ||
And I should not see "User 2" in the "conversations" "message_area_region_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@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 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@core @message @javascript | ||
Feature: Search users | ||
In order to communicate with fellow users | ||
As a user | ||
I need to be able to add and remove them from my contacts | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| user1 | User | 1 | user1@example.com | | ||
| user2 | User | 2 | user2@example.com | | ||
| user3 | User | 3 | user3@example.com | | ||
And I log in as "user1" | ||
And I view the "User 2" contact in the message area | ||
And I click on "Add contact" "link" | ||
And I view the "User 3" contact in the message area | ||
And I click on "Add contact" "link" | ||
And I log out | ||
|
||
Scenario: Add contact shows in contacts tab | ||
When I log in as "user1" | ||
And I follow "Messages" in the user menu | ||
And I click on "contacts-view" "message_area_action" | ||
Then I should see "User 2" in the "contacts" "message_area_region_content" | ||
And I should see "User 3" in the "contacts" "message_area_region_content" | ||
|
||
Scenario: Remove contact | ||
When I log in as "user1" | ||
And I view the "User 3" contact in the message area | ||
And I click on "Remove contact" "link" | ||
And I reload the page | ||
And I click on "contacts-view" "message_area_action" | ||
Then I should see "User 2" in the "contacts" "message_area_region_content" | ||
And I should not see "User 3" in the "contacts" "message_area_region_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@core @message @javascript | ||
Feature: Reply message | ||
In order to communicate with fellow users | ||
As a user | ||
I need to be able to reply to a message | ||
|
||
Scenario: Reply to a message | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| user1 | User | 1 | user1@example.com | | ||
| user2 | User | 2 | user2@example.com | | ||
And I log in as "user2" | ||
And I send "User 2 to User 1" message to "User 1" user | ||
And I log out | ||
When I log in as "user1" | ||
And I follow "Messages" in the user menu | ||
And I click on "User 2" "text" in the "conversations" "message_area_region_content" | ||
And I send "Reply to User 2" message in the message area | ||
And I log out | ||
Then I log in as "user2" | ||
And I follow "Messages" in the user menu | ||
And I should see "Reply to User 2" in the "conversations" "message_area_region_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@core @message @javascript | ||
Feature: Search messages | ||
In order to communicate with fellow users | ||
As a user | ||
I need to be able to search my messages | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| user1 | User | 1 | user1@example.com | | ||
| user2 | User | 2 | user2@example.com | | ||
| user3 | User | 3 | user3@example.com | | ||
And I log in as "user2" | ||
And I send "User 2 to User 1" message to "User 1" user | ||
And I log out | ||
And I log in as "user3" | ||
And I send "User 3 to User 1" message to "User 1" user | ||
And I log out | ||
|
||
Scenario: Search for messages | ||
When I log in as "user1" | ||
And I follow "Messages" in the user menu | ||
And I set the field "Search messages" to "User 2 to User 1" | ||
Then I should see "User 2" in the "search-results-area" "message_area_region" | ||
And I should not see "User 3" in the "search-results-area" "message_area_region" | ||
|
||
Scenario: Search for messages no results | ||
When I log in as "user1" | ||
And I follow "Messages" in the user menu | ||
And I set the field "Search messages" to "No message" | ||
Then I should see "No results" in the "search-results-area" "message_area_region" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@core @message @javascript | ||
Feature: Search users | ||
In order to communicate with fellow users | ||
As a user | ||
I need to be able to search for them | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| user1 | User | 1 | user1@example.com | | ||
| user2 | User | 2 | user2@example.com | | ||
| user3 | User | 3 | user3@example.com | | ||
|
||
Scenario: Search for single user | ||
When I log in as "user1" | ||
And I follow "Messages" in the user menu | ||
And I click on "contacts-view" "message_area_action" | ||
And I set the field "Search for a user or course" to "User 2" | ||
Then I should see "User 2" in the "search-results-area" "message_area_region" | ||
And I should not see "User 3" in the "search-results-area" "message_area_region" | ||
|
||
Scenario: Search for multiple user | ||
When I log in as "user1" | ||
And I follow "Messages" in the user menu | ||
And I click on "contacts-view" "message_area_action" | ||
And I set the field "Search for a user or course" to "User" | ||
Then I should see "User 2" in the "search-results-area" "message_area_region" | ||
And I should see "User 3" in the "search-results-area" "message_area_region" | ||
And I should not see "User 1" in the "search-results-area" "message_area_region" | ||
|
||
Scenario: Search for messages no results | ||
When I log in as "user1" | ||
And I follow "Messages" in the user menu | ||
And I click on "contacts-view" "message_area_action" | ||
And I set the field "Search for a user or course" to "No User" | ||
Then I should see "No results" in the "search-results-area" "message_area_region" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@core @message @javascript | ||
Feature: View messages | ||
In order to communicate with fellow users | ||
As a user | ||
I need to be able to view my messages | ||
|
||
Scenario: View messages from multiple users | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| user1 | User | 1 | user1@example.com | | ||
| user2 | User | 2 | user2@example.com | | ||
| user3 | User | 3 | user3@example.com | | ||
And I log in as "user2" | ||
And I send "User 2 to User 1" message to "User 1" user | ||
And I log out | ||
And I log in as "user3" | ||
And I send "User 3 to User 1" message to "User 1" user | ||
And I log out | ||
And I log in as "user1" | ||
When I follow "Messages" in the user menu | ||
Then I should see "User 3 to User 1" in the "conversations" "message_area_region_content" | ||
And I click on "User 2" "text" in the "conversations" "message_area_region_content" | ||
And I should see "User 2 to User 1" in the "conversations" "message_area_region_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ Feature: Access to full profiles of users | |
And I press "Add" | ||
And I log out | ||
When I log in as "student1" | ||
And I view the message profile for "Student 3" user | ||
And I view the "Student 3" contact in messages | ||
And I follow "View profile" | ||
Then I should see "First access to site" | ||
|
||
|
@@ -99,7 +99,7 @@ Feature: Access to full profiles of users | |
And I press "Save and display" | ||
And I log out | ||
When I log in as "student1" | ||
And I view the message profile for "Student 2" user | ||
And I view the "Student 2" contact in messages | ||
And I follow "View profile" | ||
And I should not see "First access to site" | ||
And I should see "The details of this user are not available to you" | ||
|
@@ -117,6 +117,6 @@ Feature: Access to full profiles of users | |
And I add "Student 2 ([email protected])" user to "Group 1" group members | ||
And I log out | ||
And I log in as "student1" | ||
And I view the message profile for "Student 2" user | ||
And I view the "Student 2" contact in messages | ||
And I follow "View profile" | ||
Then I should see "First access to site" |