Skip to content
Permalink
Browse files

MDL-63303 message: remove behat tests for messaging

  • Loading branch information
ryanwyllie committed Oct 31, 2018
1 parent 142b042 commit f074d6f0868fff6586bac09e5db8c79ea6713817
@@ -185,13 +185,13 @@ public function __construct() {
.//*[self::label or self::div[contains(concat(' ', @class, ' '), ' fstaticlabel ')]][contains(., %locator%)]/ancestor::*[contains(concat(' ', @class, ' '), ' fitem ')]
XPATH
, 'message_area_region' => <<<XPATH
.//div[@data-region='messaging-area']/descendant::*[@data-region = %locator%]
.//div[@data-region='message-drawer']/descendant::*[@data-region = %locator%]
XPATH
, 'message_area_region_content' => <<<XPATH
.//div[@data-region='messaging-area']/descendant::*[@data-region-content = %locator%]
.//div[@data-region='message-drawer']/descendant::*[@data-region-content = %locator%]
XPATH
, 'message_area_action' => <<<XPATH
.//div[@data-region='messaging-area']/descendant::*[@data-action = %locator%]
.//div[@data-region='message-drawer']/descendant::*[@data-action = %locator%]
XPATH
, 'autocomplete_selection' => <<<XPATH
.//div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'form-autocomplete-selection', ' '))]/span[@role='listitem'][contains(normalize-space(.), %locator%)]

This file was deleted.

This file was deleted.

@@ -71,28 +71,30 @@ public function i_select_user_in_messaging($userfullname) {
// Visit home page and follow messages.
$this->execute("behat_general::i_am_on_homepage");

$this->execute("behat_navigation::i_follow_in_the_user_menu", get_string('messages', 'message'));
$this->execute("behat_general::i_click_on", [get_string('togglemessagemenu', 'core_message'), 'link']);

$this->execute('behat_general::i_click_on', array("contacts-view", 'message_area_action'));
$this->execute('behat_general::i_click_on', [get_string('search', 'core'), 'field']);

$this->execute('behat_general::wait_until_the_page_is_ready');

$this->execute('behat_forms::i_set_the_field_to',
array(get_string('searchforuserorcourse', 'message'), $this->escape($userfullname))
$this->execute('behat_forms::i_set_the_field_with_xpath_to',
[
"//*[@data-region='message-drawer']//input[@data-region='search-input']",
$this->escape($userfullname)
]
);

$this->execute('behat_general::i_click_on', ['[data-action="search"]', 'css_element']);

$this->execute('behat_general::wait_until_the_page_is_ready');

// Need to limit the click to the search results because the 'view-contact-profile' elements
// can occur in two separate divs on the page.
$this->execute('behat_general::i_click_on_in_the',
array(
"//div[@data-action='view-contact-msg']
[./div[contains(normalize-space(.), '" . $this->escape($userfullname) . "')]]",
'xpath_element',
"[data-region='messaging-area'] [data-region='search-results-area']",
[
$this->escape($userfullname),
'link',
"[data-region='message-drawer'] [data-region='search-results-container']",
"css_element",
)
]
);

$this->execute('behat_general::wait_until_the_page_is_ready');
@@ -113,7 +115,14 @@ public function i_send_message_to_user($messagecontent, $userfullname) {
array("//textarea[@data-region='send-message-txt']", $this->escape($messagecontent))
);

$this->execute("behat_forms::press_button", get_string('send', 'message'));
$this->execute('behat_general::i_click_on_in_the',
[
'[data-action="send-message"]',
'css_element',
"[data-region='message-drawer'] [data-region='footer-container'] [data-region='view-conversation']",
"css_element",
]
);
}

/**

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f074d6f

Please sign in to comment.
You can’t perform that action at this time.