Skip to content

Commit

Permalink
MDL-63303 message: remove behat tests for messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwyllie committed Nov 15, 2018
1 parent 142b042 commit f074d6f
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 458 deletions.
6 changes: 3 additions & 3 deletions lib/behat/classes/partial_named_selector.php
Expand Up @@ -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%)]
Expand Down

This file was deleted.

60 changes: 0 additions & 60 deletions message/output/popup/tests/behat/message_popover_unread.feature

This file was deleted.

35 changes: 22 additions & 13 deletions message/tests/behat/behat_message.php
Expand Up @@ -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');
Expand All @@ -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",
]
);
}

/**
Expand Down
37 changes: 0 additions & 37 deletions message/tests/behat/delete_all_messages.feature

This file was deleted.

41 changes: 0 additions & 41 deletions message/tests/behat/delete_messages.feature

This file was deleted.

55 changes: 0 additions & 55 deletions message/tests/behat/manage_contacts.feature

This file was deleted.

35 changes: 0 additions & 35 deletions message/tests/behat/reply_message.feature

This file was deleted.

42 changes: 0 additions & 42 deletions message/tests/behat/search_messages.feature

This file was deleted.

0 comments on commit f074d6f

Please sign in to comment.