MDL-66559 message: Move behat selectors to message subsystem

This commit is contained in:
Andrew Nicols 2019-08-30 11:32:32 +08:00
parent 61832faefd
commit 5c783f140e
10 changed files with 234 additions and 166 deletions

View File

@ -276,6 +276,11 @@ XPATH
/** @var List of deprecated selectors */
protected static $deprecatedselectors = [
'group_message' => 'core_message > Message',
'group_message_member' => 'core_message > Message member',
'group_message_tab' => 'core_message > Message tab',
'group_message_list_area' => 'core_message > Message list area',
'group_message_message_content' => 'core_message > Message content',
];
/**

View File

@ -37,6 +37,69 @@ require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
*/
class behat_message extends behat_base {
/**
* Return the list of partial named selectors.
*
* @return array
*/
public static function get_partial_named_selectors(): array {
return [
new behat_component_named_selector('Message', [".//*[@data-conversation-id]//img[%altMatch%]/.."]),
new behat_component_named_selector('Message conversation', [
<<<XPATH
.//*[@data-region='message-drawer' and contains(., %locator%)]//div[@data-region='content-message-container']
XPATH
], false),
new behat_component_named_selector('Message header', [
<<<XPATH
.//*[@data-region='message-drawer']//div[@data-region='header-content' and contains(., %locator%)]
XPATH
]),
new behat_component_named_selector('Message member', [
<<<XPATH
.//*[@data-region='message-drawer']//div[@data-region='group-info-content-container']
//div[@class='list-group' and not(contains(@class, 'hidden'))]//*[%core_message/textMatch%]
XPATH
, <<<XPATH
.//*[@data-region='message-drawer']//div[@data-region='group-info-content-container']
//div[@data-region='empty-message-container' and not(contains(@class, 'hidden')) and contains(., %locator%)]
XPATH
], false),
new behat_component_named_selector('Message tab', [
<<<XPATH
.//*[@data-region='message-drawer']//button[@data-toggle='collapse' and contains(string(), %locator%)]
XPATH
], false),
new behat_component_named_selector('Message list area', [
<<<XPATH
.//*[@data-region='message-drawer']//*[contains(@data-region, concat('view-overview-', %locator%))]
XPATH
], false),
new behat_component_named_selector('Message content', [
<<<XPATH
.//*[@data-region='message-drawer']//*[@data-region='message' and @data-message-id and contains(., %locator%)]
XPATH
], false),
];
}
/**
* Return a list of the Mink named replacements for the component.
*
* Named replacements allow you to define parts of an xpath that can be reused multiple times, or in multiple
* xpaths.
*
* This method should return a list of {@link behat_component_named_replacement} and the docs on that class explain
* how it works.
*
* @return behat_component_named_replacement[]
*/
public static function get_named_replacements(): array {
return [
new behat_component_named_replacement('textMatch', 'text()[contains(., %locator%)]'),
];
}
/**
* Open the messaging UI.
*
@ -57,7 +120,7 @@ class behat_message extends behat_base {
public function i_open_the_conversations_list(string $tab) {
$this->execute('behat_general::i_click_on', [
$this->escape($tab),
'group_message_tab'
'core_message > Message tab'
]);
}
@ -213,7 +276,7 @@ class behat_message extends behat_base {
$this->execute('behat_general::i_click_on',
array(
$this->escape($conversationname),
'group_message',
'core_message > Message',
)
);
}

View File

@ -40,15 +40,15 @@ Feature: Delete messages from conversations
Scenario: Delete a message sent by the user from a group conversation
Given I log in as "student1"
And I open messaging
And "Group 1" "group_message" should exist
And "Group 1" "core_message > Message" should exist
And I select "Group 1" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "How are you?" "group_message_message_content"
And I click on "Can somebody help me?" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I click on "How are you?" "core_message > Message content"
And I click on "Can somebody help me?" "core_message > Message content"
And I should see "3" in the "[data-region='message-selected-court']" "css_element"
# Clicking to unselect
And I click on "How are you?" "group_message_message_content"
And I click on "Can somebody help me?" "group_message_message_content"
And I click on "How are you?" "core_message > Message content"
And I click on "Can somebody help me?" "core_message > Message content"
And I should see "1" in the "[data-region='message-selected-court']" "css_element"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
@ -57,19 +57,19 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='confirm-delete-selected-messages']" "xpath_element"
Then I should not see "Delete"
And I should not see "Hi!"
And I should see "##today##j F##" in the "Group 1" "group_message_conversation"
And I should see "How are you?" in the "Group 1" "group_message_conversation"
And I should see "Can somebody help me?" in the "Group 1" "group_message_conversation"
And I should see "##today##j F##" in the "Group 1" "core_message > Message conversation"
And I should see "How are you?" in the "Group 1" "core_message > Message conversation"
And I should see "Can somebody help me?" in the "Group 1" "core_message > Message conversation"
And I should not see "Messages selected"
Scenario: Delete two messages from a group conversation; one sent by another user.
Given I log in as "student1"
And I open messaging
And "Group 1" "group_message" should exist
And "Group 1" "core_message > Message" should exist
And I select "Group 1" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I should see "1" in the "[data-region='message-selected-court']" "css_element"
And I click on "How are you?" "group_message_message_content"
And I click on "How are you?" "core_message > Message content"
And I should see "2" in the "[data-region='message-selected-court']" "css_element"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
@ -78,9 +78,9 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='confirm-delete-selected-messages']" "xpath_element"
Then I should not see "Delete"
And I should not see "Hi!"
And I should see "##today##j F##" in the "Group 1" "group_message_conversation"
And I should not see "How are you?" in the "Group 1" "group_message_conversation"
And I should see "Can somebody help me?" in the "Group 1" "group_message_conversation"
And I should see "##today##j F##" in the "Group 1" "core_message > Message conversation"
And I should not see "How are you?" in the "Group 1" "core_message > Message conversation"
And I should see "Can somebody help me?" in the "Group 1" "core_message > Message conversation"
And I should not see "Messages selected"
# Check messages were not deleted for other users
And I log out
@ -94,10 +94,10 @@ Feature: Delete messages from conversations
Scenario: Cancel deleting two messages from a group conversation
Given I log in as "student1"
And I open messaging
And "Group 1" "group_message" should exist
And "Group 1" "core_message > Message" should exist
And I select "Group 1" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "How are you?" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I click on "How are you?" "core_message > Message content"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
# Canceling deletion, so messages should be there
@ -105,7 +105,7 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='cancel-confirm']" "xpath_element"
Then I should not see "Cancel"
And I should see "Hi!"
And I should see "How are you?" in the "Group 1" "group_message_conversation"
And I should see "How are you?" in the "Group 1" "core_message > Message conversation"
And I should see "2" in the "[data-region='message-selected-court']" "css_element"
Scenario: Delete a message sent by the user from a private conversation
@ -115,7 +115,7 @@ Feature: Delete messages from conversations
And I open the "Private" conversations list
And I should see "Student 2"
And I select "Student 2" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I should see "1" in the "[data-region='message-selected-court']" "css_element"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
@ -124,9 +124,9 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='confirm-delete-selected-messages']" "xpath_element"
Then I should not see "Delete"
And I should not see "Hi!"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
And I should see "Hello!" in the "Student 2" "group_message_conversation"
And I should see "Are you free?" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
And I should see "Hello!" in the "Student 2" "core_message > Message conversation"
And I should see "Are you free?" in the "Student 2" "core_message > Message conversation"
And I should not see "Messages selected"
Scenario: Delete two messages from a private conversation; one sent by another user
@ -136,9 +136,9 @@ Feature: Delete messages from conversations
And I open the "Private" conversations list
And I should see "Student 2"
And I select "Student 2" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I should see "1" in the "[data-region='message-selected-court']" "css_element"
And I click on "Hello!" "group_message_message_content"
And I click on "Hello!" "core_message > Message content"
And I should see "2" in the "[data-region='message-selected-court']" "css_element"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
@ -147,9 +147,9 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='confirm-delete-selected-messages']" "xpath_element"
Then I should not see "Delete"
And I should not see "Hi!"
And I should not see "Hello!" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
And I should see "Are you free?" in the "Student 2" "group_message_conversation"
And I should not see "Hello!" in the "Student 2" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
And I should see "Are you free?" in the "Student 2" "core_message > Message conversation"
And I should not see "Messages selected"
# Check messages were not deleted for the other user
And I log out
@ -168,8 +168,8 @@ Feature: Delete messages from conversations
And I open the "Private" conversations list
And I should see "Student 2"
And I select "Student 2" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "Hello!" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I click on "Hello!" "core_message > Message content"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
# Canceling deletion, so messages should be there
@ -177,7 +177,7 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='cancel-confirm']" "xpath_element"
Then I should not see "Cancel"
And I should see "Hi!"
And I should see "Hello!" in the "Student 2" "group_message_conversation"
And I should see "Hello!" in the "Student 2" "core_message > Message conversation"
And I should see "2" in the "[data-region='message-selected-court']" "css_element"
Scenario: Delete a message sent by the user from a favorite conversation
@ -188,7 +188,7 @@ Feature: Delete messages from conversations
And I open messaging
And I should see "Student 2"
And I select "Student 2" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I should see "1" in the "[data-region='message-selected-court']" "css_element"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
@ -197,8 +197,8 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='confirm-delete-selected-messages']" "xpath_element"
Then I should not see "Delete"
And I should not see "Hi!"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
And I should see "Hello!" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
And I should see "Hello!" in the "Student 2" "core_message > Message conversation"
And I should not see "Messages selected"
Scenario: Delete two messages from a favourite conversation; one sent by another user
@ -209,9 +209,9 @@ Feature: Delete messages from conversations
And I open messaging
And I should see "Student 2"
And I select "Student 2" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I should see "1" in the "[data-region='message-selected-court']" "css_element"
And I click on "Hello!" "group_message_message_content"
And I click on "Hello!" "core_message > Message content"
And I should see "2" in the "[data-region='message-selected-court']" "css_element"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
@ -220,9 +220,9 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='confirm-delete-selected-messages']" "xpath_element"
Then I should not see "Delete"
And I should not see "Hi!"
And I should not see "Hello!" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
And I should see "Are you free?" in the "Student 2" "group_message_conversation"
And I should not see "Hello!" in the "Student 2" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
And I should see "Are you free?" in the "Student 2" "core_message > Message conversation"
And I should not see "Messages selected"
Scenario: Cancel deleting two messages from a favourite conversation
@ -233,8 +233,8 @@ Feature: Delete messages from conversations
And I open messaging
And I should see "Student 2"
And I select "Student 2" conversation in messaging
And I click on "Hi!" "group_message_message_content"
And I click on "Hello!" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I click on "Hello!" "core_message > Message content"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
# Canceling deletion, so messages should be there
@ -242,7 +242,7 @@ Feature: Delete messages from conversations
And I click on "//button[@data-action='cancel-confirm']" "xpath_element"
Then I should not see "Cancel"
And I should see "Hi!"
And I should see "Hello!" in the "Student 2" "group_message_conversation"
And I should see "Hello!" in the "Student 2" "core_message > Message conversation"
And I should see "2" in the "[data-region='message-selected-court']" "css_element"
Scenario: Check an empty favourite conversation is still favourite
@ -253,9 +253,9 @@ Feature: Delete messages from conversations
And I open messaging
And I should see "Student 2"
And I select "Student 2" conversation in the "favourites" conversations list
And I click on "Hi!" "group_message_message_content"
And I click on "Hello!" "group_message_message_content"
And I click on "Are you free?" "group_message_message_content"
And I click on "Hi!" "core_message > Message content"
And I click on "Hello!" "core_message > Message content"
And I click on "Are you free?" "core_message > Message content"
And "Delete selected messages" "button" should exist
When I click on "Delete selected messages" "button"
And I should see "Delete"

View File

@ -31,35 +31,35 @@ Feature: Star and unstar conversations
Given I log in as "student1"
Then I open messaging
And I open the "Group" conversations list
And "Group 1" "group_message" should exist
And "Group 1" "core_message > Message" should exist
And I select "Group 1" conversation in messaging
And I open contact menu
And I click on "Star" "link" in the "//div[@data-region='header-container']" "xpath_element"
And I go back in "view-conversation" message drawer
And I open the "Starred" conversations list
And I should see "Group 1" in the "favourites" "group_message_list_area"
And I should see "Group 1" in the "favourites" "core_message > Message list area"
And I open the "Group" conversations list
And I should not see "Group 1" in the "group-messages" "group_message_list_area"
And I should not see "Group 1" in the "group-messages" "core_message > Message list area"
Scenario: Unstar a group conversation
Given I log in as "student1"
Then I open messaging
And I open the "Group" conversations list
And "Group 1" "group_message" should exist
And "Group 1" "core_message > Message" should exist
And I select "Group 1" conversation in messaging
And I open contact menu
And I click on "Star" "link" in the "//div[@data-region='header-container']" "xpath_element"
And I go back in "view-conversation" message drawer
And I open the "Starred" conversations list
And I should see "Group 1" in the "favourites" "group_message_list_area"
And I should see "Group 1" in the "favourites" "core_message > Message list area"
And I select "Group 1" conversation in messaging
And I open contact menu
And I click on "Unstar" "link" in the "//div[@data-region='header-container']" "xpath_element"
And I go back in "view-conversation" message drawer
And I open the "Starred" conversations list
And I should not see "Group 1" in the "favourites" "group_message_list_area"
And I should not see "Group 1" in the "favourites" "core_message > Message list area"
And I open the "Group" conversations list
And I should see "Group 1" in the "group-messages" "group_message_list_area"
And I should see "Group 1" in the "group-messages" "core_message > Message list area"
Scenario: Star a private conversation
Given the following "private messages" exist:
@ -68,15 +68,15 @@ Feature: Star and unstar conversations
Then I log in as "student1"
And I open messaging
And I open the "Private" conversations list
And "Student 2" "group_message" should exist
And "Student 2" "core_message > Message" should exist
And I select "Student 2" conversation in messaging
And I open contact menu
And I click on "Star" "link" in the "//div[@data-region='header-container']" "xpath_element"
And I go back in "view-conversation" message drawer
And I open the "Starred" conversations list
And I should see "Student 2" in the "favourites" "group_message_list_area"
And I should see "Student 2" in the "favourites" "core_message > Message list area"
And I open the "Private" conversations list
And I should not see "Student 2" in the "messages" "group_message_list_area"
And I should not see "Student 2" in the "messages" "core_message > Message list area"
Scenario: Unstar a private conversation
Given the following "private messages" exist:
@ -87,12 +87,12 @@ Feature: Star and unstar conversations
| student1 | student2 |
Then I log in as "student1"
And I open messaging
And I should see "Student 2" in the "favourites" "group_message_list_area"
And I should see "Student 2" in the "favourites" "core_message > Message list area"
And I select "Student 2" conversation in messaging
And I open contact menu
And I click on "Unstar" "link" in the "//div[@data-region='header-container']" "xpath_element"
And I go back in "view-conversation" message drawer
And I open the "Starred" conversations list
And I should not see "Group 1" in the "favourites" "group_message_list_area"
And I should not see "Group 1" in the "favourites" "core_message > Message list area"
And I open the "Private" conversations list
And I should see "Student 2" in the "messages" "group_message_list_area"
And I should see "Student 2" in the "messages" "core_message > Message list area"

View File

@ -47,26 +47,26 @@ Feature: Create conversations for course's groups
Given I log in as "teacher1"
Then I open messaging
And I open the "Group" conversations list
And "Group 1" "group_message" should exist
And "Group 2" "group_message" should exist
And "Group 3" "group_message" should not exist
And "Group 1" "core_message > Message" should exist
And "Group 2" "core_message > Message" should exist
And "Group 3" "core_message > Message" should not exist
And I log out
And I log in as "student1"
And I open messaging
And I open the "Group" conversations list
And "Group 1" "group_message" should exist
And "Group 2" "group_message" should not exist
And "Group 3" "group_message" should not exist
And "Group 1" "core_message > Message" should exist
And "Group 2" "core_message > Message" should not exist
And "Group 3" "core_message > Message" should not exist
Scenario: View group conversation's participants numbers
Given I log in as "teacher1"
Then I open messaging
And I open the "Group" conversations list
And I select "Group 1" conversation in messaging
And I should see "5 participants" in the "Group 1" "group_message_header"
And I should see "5 participants" in the "Group 1" "core_message > Message header"
And I go back in "view-conversation" message drawer
And I select "Group 2" conversation in messaging
And I should see "1 participants" in the "Group 2" "group_message_header"
And I should see "1 participants" in the "Group 2" "core_message > Message header"
Scenario: View group conversation's participants list
Given I log in as "teacher1"
@ -75,20 +75,20 @@ Feature: Create conversations for course's groups
# Check Group 1 participants list.
And I select "Group 1" conversation in messaging
And I open messaging information
And "Teacher 1" "group_message_member" should not exist
And "Student 0" "group_message_member" should exist
And "Student 1" "group_message_member" should exist
And "Student 2" "group_message_member" should exist
And "Student 3" "group_message_member" should exist
And "Student 4" "group_message_member" should not exist
And "Teacher 1" "core_message > Message member" should not exist
And "Student 0" "core_message > Message member" should exist
And "Student 1" "core_message > Message member" should exist
And "Student 2" "core_message > Message member" should exist
And "Student 3" "core_message > Message member" should exist
And "Student 4" "core_message > Message member" should not exist
And I go back in "group-info-content-container" message drawer
And I go back in "view-conversation" message drawer
# Check Group 2 participants list.
And I select "Group 2" conversation in messaging
And I open messaging information
And "Teacher 1" "group_message_member" should not exist
And "No participants" "group_message_member" should exist
And "Student 4" "group_message_member" should not exist
And "Teacher 1" "core_message > Message member" should not exist
And "No participants" "core_message > Message member" should exist
And "Student 4" "core_message > Message member" should not exist
Scenario: Check group conversation members are synced when a new group member is added
Given I log in as "teacher1"
@ -99,13 +99,13 @@ Feature: Create conversations for course's groups
And I open messaging
And I open the "Group" conversations list
And I select "Group 1" conversation in messaging
And I should see "6 participants" in the "Group 1" "group_message_header"
And I should see "6 participants" in the "Group 1" "core_message > Message header"
And I open messaging information
And "Student 4" "group_message_member" should exist
And "Student 4" "core_message > Message member" should exist
And I go back in "group-info-content-container" message drawer
And I go back in "view-conversation" message drawer
And I select "Group 2" conversation in messaging
And I should see "2 participants" in the "Group 2" "group_message_header"
And I should see "2 participants" in the "Group 2" "core_message > Message header"
And I open messaging information
And "No participants" "group_message_member" should not exist
And "Student 4" "group_message_member" should exist
And "No participants" "core_message > Message member" should not exist
And "Student 4" "core_message > Message member" should exist

View File

@ -35,17 +35,17 @@ Feature: Message delete conversations
And I should see "Delete"
And I click on "//button[@data-action='confirm-delete-conversation']" "xpath_element"
And I should not see "Delete"
And I should not see "Hi!" in the "Student 1" "group_message_conversation"
And I should not see "What do you need?" in the "Student 1" "group_message_conversation"
And I should not see "##today##j F##" in the "Student 1" "group_message_conversation"
And I should not see "Hi!" in the "Student 1" "core_message > Message conversation"
And I should not see "What do you need?" in the "Student 1" "core_message > Message conversation"
And I should not see "##today##j F##" in the "Student 1" "core_message > Message conversation"
# Check user is deleting private conversation only for them
And I log out
And I log in as "student1"
And I open messaging
And I select "Student 2" conversation in the "messages" conversations list
And I should see "Hi!" in the "Student 2" "group_message_conversation"
And I should see "What do you need?" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
And I should see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should see "What do you need?" in the "Student 2" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
Scenario: Cancel deleting a private conversation
Given I log in as "student1"
@ -57,8 +57,8 @@ Feature: Message delete conversations
And I should see "Cancel"
And I click on "//button[@data-action='cancel-confirm']" "xpath_element"
And I should not see "Cancel"
And I should see "Hi!" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
And I should see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
Scenario: Delete a starred conversation
Given the following "favourite conversations" exist:
@ -73,17 +73,17 @@ Feature: Message delete conversations
And I should see "Delete"
And I click on "//button[@data-action='confirm-delete-conversation']" "xpath_element"
And I should not see "Delete"
And I should not see "Hi!" in the "Student 2" "group_message_conversation"
And I should not see "What do you need?" in the "Student 2" "group_message_conversation"
And I should not see "##today##j F##" in the "Student 2" "group_message_conversation"
And I should not see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should not see "What do you need?" in the "Student 2" "core_message > Message conversation"
And I should not see "##today##j F##" in the "Student 2" "core_message > Message conversation"
# Check user is deleting private conversation only for them
And I log out
And I log in as "student2"
And I open messaging
And I select "Student 1" conversation in the "messages" conversations list
And I should see "Hi!" in the "Student 1" "group_message_conversation"
And I should see "What do you need?" in the "Student 1" "group_message_conversation"
And I should see "##today##j F##" in the "Student 1" "group_message_conversation"
And I should see "Hi!" in the "Student 1" "core_message > Message conversation"
And I should see "What do you need?" in the "Student 1" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 1" "core_message > Message conversation"
Scenario: Cancel deleting a starred conversation
Given the following "favourite conversations" exist:
@ -92,16 +92,16 @@ Feature: Message delete conversations
When I log in as "student1"
And I open messaging
And I select "Student 2" conversation in the "favourites" conversations list
Then I should see "Hi!" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
Then I should see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
And I open contact menu
And I click on "Delete conversation" "link" in the "//div[@data-region='header-container']" "xpath_element"
# Cancel deletion, so conversation should be there
And I should see "Cancel"
And I click on "//button[@data-action='cancel-confirm']" "xpath_element"
And I should not see "Cancel"
And I should see "Hi!" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
And I should see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
Scenario: Check a deleted starred conversation is still starred
Given the following "favourite conversations" exist:
@ -115,10 +115,10 @@ Feature: Message delete conversations
Then I should see "Delete"
And I click on "//button[@data-action='confirm-delete-conversation']" "xpath_element"
And I should not see "Delete"
And I should not see "Hi!" in the "Student 2" "group_message_conversation"
And I should not see "Hi!" in the "Student 2" "core_message > Message conversation"
And I go back in "view-conversation" message drawer
And I should not see "Student 2" in the "favourites" "group_message_list_area"
And I should not see "Student 2" in the "favourites" "core_message > Message list area"
And I send "Hi!" message to "Student 2" user
And I go back in "view-conversation" message drawer
And I go back in "view-search" message drawer
And I should see "Student 2" in the "favourites" "group_message_list_area"
And I should see "Student 2" in the "favourites" "core_message > Message list area"

View File

@ -31,23 +31,23 @@ Feature: Message send messages
Given I log in as "student1"
And I open messaging
And I open the "Group" conversations list
And "Group 1" "group_message" should exist
And "Group 1" "core_message > Message" should exist
And I select "Group 1" conversation in messaging
When I send "Hi!" message in the message area
Then I should see "Hi!" in the "Group 1" "group_message_conversation"
And I should see "##today##j F##" in the "Group 1" "group_message_conversation"
Then I should see "Hi!" in the "Group 1" "core_message > Message conversation"
And I should see "##today##j F##" in the "Group 1" "core_message > Message conversation"
And I log out
And I log in as "student2"
And I open messaging
And "Group 1" "group_message" should exist
And "Group 1" "core_message > Message" should exist
And I select "Group 1" conversation in messaging
And I should see "Hi!" in the "Group 1" "group_message_conversation"
And I should see "Hi!" in the "Group 1" "core_message > Message conversation"
Scenario: Send a message to a starred conversation
Given I log in as "student1"
When I open messaging
And I open the "Group" conversations list
Then "Group 1" "group_message" should exist
Then "Group 1" "core_message > Message" should exist
And I select "Group 1" conversation in the "group-messages" conversations list
And I open contact menu
And I click on "Star" "link" in the "//div[@data-region='header-container']" "xpath_element"
@ -56,11 +56,11 @@ Feature: Message send messages
And I should see "Group 1"
And I select "Group 1" conversation in the "favourites" conversations list
And I send "Hi!" message in the message area
And I should see "Hi!" in the "Group 1" "group_message_conversation"
And I should see "##today##j F##" in the "Group 1" "group_message_conversation"
And I should see "Hi!" in the "Group 1" "core_message > Message conversation"
And I should see "##today##j F##" in the "Group 1" "core_message > Message conversation"
And I go back in "view-conversation" message drawer
And I open the "Group" conversations list
And I should not see "Group 1" in the "Group" "group_message_tab"
And I should not see "Group 1" in the "Group" "core_message > Message tab"
Scenario: Send a message to a private conversation via contact tab
Given the following "message contacts" exist:
@ -71,17 +71,17 @@ Feature: Message send messages
And I click on "Contacts" "link"
And I click on "Student 2" "link" in the "//*[@data-section='contacts']" "xpath_element"
When I send "Hi!" message in the message area
Then I should see "Hi!" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
Then I should see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
Scenario: Try to send a message to a private conversation is not contact but you are allowed to send a message
Given I log in as "student1"
And I open messaging
When I send "Hi!" message to "Student 2" user
Then I should see "Hi!" in the "Student 2" "group_message_conversation"
And I should see "##today##j F##" in the "Student 2" "group_message_conversation"
Then I should see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 2" "core_message > Message conversation"
And I log out
And I log in as "student2"
And I open messaging
And I select "Student 1" conversation in messaging
And I should see "Hi!" in the "Student 1" "group_message_conversation"
And I should see "Hi!" in the "Student 1" "core_message > Message conversation"

View File

@ -33,15 +33,15 @@ Feature: Mute and unmute conversations
Given I log in as "student1"
When I open messaging
And I open the "Group" conversations list
Then "Group 1" "group_message" should exist
And "muted" "icon_container" in the "Group 1" "group_message" should not be visible
Then "Group 1" "core_message > Message" should exist
And "muted" "icon_container" in the "Group 1" "core_message > Message" should not be visible
And I select "Group 1" conversation in messaging
And "muted" "icon_container" in the "Group 1" "group_message_header" should not be visible
And "muted" "icon_container" in the "Group 1" "core_message > Message header" should not be visible
And I open contact menu
And I click on "Mute" "link" in the "[data-region='header-container']" "css_element"
And "muted" "icon_container" in the "Group 1" "group_message_header" should be visible
And "muted" "icon_container" in the "Group 1" "core_message > Message header" should be visible
And I go back in "view-conversation" message drawer
And "muted" "icon_container" in the "Group 1" "group_message" should be visible
And "muted" "icon_container" in the "Group 1" "core_message > Message" should be visible
Scenario: Mute a private conversation
When I log in as "student1"
@ -49,14 +49,14 @@ Feature: Mute and unmute conversations
Then I should see "Private"
And I open the "Private" conversations list
And I should see "Student 2"
And "muted" "icon_container" in the "Student 2" "group_message" should not be visible
And "muted" "icon_container" in the "Student 2" "core_message > Message" should not be visible
And I select "Student 2" conversation in messaging
And "muted" "icon_container" in the "[data-action='view-contact']" "css_element" should not be visible
And I open contact menu
And I click on "Mute" "link" in the "[data-region='header-container']" "css_element"
And "muted" "icon_container" in the "[data-action='view-contact']" "css_element" should be visible
And I go back in "view-conversation" message drawer
And "muted" "icon_container" in the "Student 2" "group_message" should be visible
And "muted" "icon_container" in the "Student 2" "core_message > Message" should be visible
Scenario: Unmute a group conversation
Given the following "muted group conversations" exist:
@ -65,15 +65,15 @@ Feature: Mute and unmute conversations
When I log in as "student1"
And I open messaging
And I open the "Group" conversations list
Then "Group 1" "group_message" should exist
And "muted" "icon_container" in the "Group 1" "group_message" should be visible
Then "Group 1" "core_message > Message" should exist
And "muted" "icon_container" in the "Group 1" "core_message > Message" should be visible
And I select "Group 1" conversation in messaging
And "muted" "icon_container" in the "Group 1" "group_message_header" should be visible
And "muted" "icon_container" in the "Group 1" "core_message > Message header" should be visible
And I open contact menu
And I click on "Unmute" "link" in the "[data-region='header-container']" "css_element"
And "muted" "icon_container" in the "Group 1" "group_message_header" should not be visible
And "muted" "icon_container" in the "Group 1" "core_message > Message header" should not be visible
And I go back in "view-conversation" message drawer
And "muted" "icon_container" in the "Group 1" "group_message" should not be visible
And "muted" "icon_container" in the "Group 1" "core_message > Message" should not be visible
Scenario: Unmute a private conversation
Given the following "muted private conversations" exist:
@ -84,11 +84,11 @@ Feature: Mute and unmute conversations
Then I should see "Private"
And I open the "Private" conversations list
And I should see "Student 2"
And "muted" "icon_container" in the "Student 2" "group_message" should be visible
And "muted" "icon_container" in the "Student 2" "core_message > Message" should be visible
And I select "Student 2" conversation in messaging
And "muted" "icon_container" in the "[data-action='view-contact']" "css_element" should be visible
And I open contact menu
And I click on "Unmute" "link" in the "[data-region='header-container']" "css_element"
And "muted" "icon_container" in the "[data-action='view-contact']" "css_element" should not be visible
And I go back in "view-conversation" message drawer
And "muted" "icon_container" in the "Student 2" "group_message" should not be visible
And "muted" "icon_container" in the "Student 2" "core_message > Message" should not be visible

View File

@ -15,47 +15,47 @@ Feature: Self conversation
Scenario: Self conversation exists
Given I log in as "student1"
When I open messaging
Then "Student 1" "group_message" should exist
Then "Student 1" "core_message > Message" should exist
And I select "Student" conversation in messaging
And I should see "Personal space"
Scenario: Self conversation can be unstarred
Given I log in as "student1"
When I open messaging
Then "Student 1" "group_message" should exist
Then "Student 1" "core_message > Message" should exist
And I select "Student" conversation in messaging
And I open contact menu
And I click on "Unstar" "link" in the "Student 1" "group_message_header"
And I click on "Unstar" "link" in the "Student 1" "core_message > Message header"
And I go back in "view-conversation" message drawer
And I open the "Starred" conversations list
And I should not see "Student 1" in the "favourites" "group_message_list_area"
And I should not see "Student 1" in the "favourites" "core_message > Message list area"
And I open the "Private" conversations list
And I should see "Student 1" in the "messages" "group_message_list_area"
And I should see "Student 1" in the "messages" "core_message > Message list area"
Scenario: Self conversation can be deleted
Given I log in as "student1"
When I open messaging
Then "Student 1" "group_message" should exist
Then "Student 1" "core_message > Message" should exist
And I select "Student 1" conversation in messaging
And I open contact menu
And I click on "Delete conversation" "link" in the "Student 1" "group_message_header"
And I click on "Delete conversation" "link" in the "Student 1" "core_message > Message header"
And I should see "Delete"
And I click on "//button[@data-action='confirm-delete-conversation']" "xpath_element"
And I should not see "Delete"
And I go back in "view-conversation" message drawer
And I open the "Starred" conversations list
And I should not see "Student 1" in the "favourites" "group_message_list_area"
And I should not see "Student 1" in the "favourites" "core_message > Message list area"
And I open the "Private" conversations list
And I should not see "Student 1" in the "messages" "group_message_list_area"
And I should not see "Student 1" in the "messages" "core_message > Message list area"
Scenario: Send a message to a self-conversation via message drawer
Given I log in as "student1"
When I open messaging
Then "Student 1" "group_message" should exist
Then "Student 1" "core_message > Message" should exist
And I select "Student 1" conversation in messaging
And I send "Hi!" message in the message area
And I should see "Hi!" in the "Student 1" "group_message_conversation"
And I should see "##today##j F##" in the "Student 1" "group_message_conversation"
And I should see "Hi!" in the "Student 1" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 1" "core_message > Message conversation"
Scenario: Send a message to a self-conversation via user profile
Given I log in as "student1"
@ -63,5 +63,5 @@ Feature: Self conversation
Then I should see "Message"
And I click on "Message" "icon"
And I send "Hi!" message in the message area
And I should see "Hi!" in the "Student 1" "group_message_conversation"
And I should see "##today##j F##" in the "Student 1" "group_message_conversation"
And I should see "Hi!" in the "Student 1" "core_message > Message conversation"
And I should see "##today##j F##" in the "Student 1" "core_message > Message conversation"

View File

@ -31,23 +31,23 @@ Feature: Unread messages
Given I log in as "student1"
When I open messaging
And I open the "Group" conversations list
Then "New group" "group_message" should exist
Then "New group" "core_message > Message" should exist
And I select "New group" conversation in messaging
And I send "Hi!" message in the message area
And I should see "Hi!" in the "New group" "group_message_conversation"
And I should see "##today##j F##" in the "New group" "group_message_conversation"
And I should see "Hi!" in the "New group" "core_message > Message conversation"
And I should see "##today##j F##" in the "New group" "core_message > Message conversation"
And I log out
And I log in as "student2"
And I should see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
And I open messaging
And I should see "1" in the "Group" "group_message_tab"
And "New group" "group_message" should exist
And I should see "1" in the "New group" "group_message"
And I should see "1" in the "Group" "core_message > Message tab"
And "New group" "core_message > Message" should exist
And I should see "1" in the "New group" "core_message > Message"
And I select "New group" conversation in messaging
And I should see "Hi!" in the "New group" "group_message_conversation"
And I should see "Hi!" in the "New group" "core_message > Message conversation"
And I should not see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
And I should not see "1" in the "Group" "group_message_tab"
And I should not see "1" in the "New group" "group_message"
And I should not see "1" in the "Group" "core_message > Message tab"
And I should not see "1" in the "New group" "core_message > Message"
Scenario: Unread messages for private conversation
Given the following "private messages" exist:
@ -57,14 +57,14 @@ Feature: Unread messages
When I log in as "student1"
Then I should see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
And I open messaging
And I should see "1" in the "Private" "group_message_tab"
And "Student 2" "group_message" should exist
And I should see "1" in the "Student 2" "group_message"
And I should see "1" in the "Private" "core_message > Message tab"
And "Student 2" "core_message > Message" should exist
And I should see "1" in the "Student 2" "core_message > Message"
And I select "Student 2" conversation in messaging
And I should see "Hi!" in the "Student 2" "group_message_conversation"
And I should see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should not see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
And I should not see "1" in the "Private" "group_message_tab"
And I should not see "1" in the "Student 2" "group_message"
And I should not see "1" in the "Private" "core_message > Message tab"
And I should not see "1" in the "Student 2" "core_message > Message"
Scenario: Unread messages for starred conversation
Given the following "private messages" exist:
@ -77,11 +77,11 @@ Feature: Unread messages
When I log in as "student1"
Then I should see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
And I open messaging
And I should see "1" in the "Starred" "group_message_tab"
And "Student 2" "group_message" should exist
And I should see "1" in the "Student 2" "group_message"
And I should see "1" in the "Starred" "core_message > Message tab"
And "Student 2" "core_message > Message" should exist
And I should see "1" in the "Student 2" "core_message > Message"
And I select "Student 2" conversation in messaging
And I should see "Hi!" in the "Student 2" "group_message_conversation"
And I should see "Hi!" in the "Student 2" "core_message > Message conversation"
And I should not see "1" in the "//*[@title='Toggle messaging drawer']/../*[@data-region='count-container']" "xpath_element"
And I should not see "1" in the "Starred" "group_message_tab"
And I should not see "1" in the "Student 2" "group_message"
And I should not see "1" in the "Starred" "core_message > Message tab"
And I should not see "1" in the "Student 2" "core_message > Message"