Commit 2a77813b authored by Andrew Nicols's avatar Andrew Nicols
Browse files

MDL-59882 behat: Update known uses of dialogue CSS

parent 434d7869
......@@ -60,8 +60,8 @@ Feature: Perform basic calendar functionality
When I am on "Course 1" course homepage
And I follow "This month"
And I click on "Really awesome event!" "link"
And "Course 1" "link" should exist in the ".modal-body" "css_element"
And I click on ".close" "css_element"
And "Course 1" "link" should exist in the "Really awesome event!" "dialogue"
And I click on ".close" "css_element" in the "Really awesome event!" "dialogue"
And I log out
And I log in as "student2"
And I follow "This month"
......
......@@ -114,5 +114,5 @@ Feature: Enrolments are synchronised with meta courses
And I navigate to course participants
# Suspended users can be unenrolled.
When I click on "//a[@data-action='unenrol']" "xpath_element" in the "student2" "table_row"
And I click on "Unenrol" "button" in the "[data-region='modal']" "css_element"
And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
Then I should not see "Student 2" in the "participants" "table"
......@@ -123,5 +123,5 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe
And I am on "Course 1" course homepage
And I navigate to course participants
When I click on "//a[@data-action='unenrol']" "xpath_element" in the "student1" "table_row"
And I click on "Unenrol" "button" in the "[data-region='modal']" "css_element"
And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
Then I should not see "Student 1" in the "participants" "table"
......@@ -19,7 +19,7 @@ Feature: Delete all messages
And I click on "start-delete-messages" "message_area_action"
And I click on "Delete all" "button"
# Confirm dialogue.
And I click on "Delete" "button" in the ".modal-footer" "css_element"
And I click on "Delete" "button" in the "Confirm" "dialogue"
# 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.
......
......@@ -38,12 +38,13 @@ require_once(__DIR__ . '/../../../../blocks/tests/behat/behat_blocks.php');
class behat_theme_boost_behat_blocks extends behat_blocks {
public function i_add_the_block($blockname) {
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('addblock'));
$addblock = get_string('addblock');
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
if (!$this->running_javascript()) {
$this->execute('behat_general::i_click_on_in_the', [$blockname, 'link_exact', '#region-main', 'css_element']);
} else {
$this->execute('behat_general::i_click_on_in_the', [$blockname, 'link_exact', '.modal-body', 'css_element']);
$this->execute('behat_general::i_click_on_in_the', [$blockname, 'link_exact', $addblock, 'dialogue']);
}
}
......@@ -66,28 +67,30 @@ class behat_theme_boost_behat_blocks extends behat_blocks {
}
public function the_add_block_selector_should_contain_block($blockname) {
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('addblock'));
$addblock = get_string('addblock');
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
$cancelstr = get_string('cancel');
if (!$this->running_javascript()) {
$this->execute('behat_general::should_exist_in_the', [$blockname, 'link_exact', '#region-main', 'css_element']);
$this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'link_exact', '#region-main', 'css_element']);
} else {
$this->execute('behat_general::should_exist_in_the', [$blockname, 'link_exact', '.modal-body', 'css_element']);
$this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'link_exact', '.modal-body', 'css_element']);
$this->execute('behat_general::should_exist_in_the', [$blockname, 'link_exact', $addblock, 'dialogue']);
$this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'button', $addblock, 'dialogue']);
}
}
public function the_add_block_selector_should_not_contain_block($blockname) {
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('addblock'));
$addblock = get_string('addblock');
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
$cancelstr = get_string('cancel');
if (!$this->running_javascript()) {
$this->execute('behat_general::should_not_exist_in_the', [$blockname, 'link_exact', '#region-main', 'css_element']);
$this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'link_exact', '#region-main', 'css_element']);
} else {
$this->execute('behat_general::should_not_exist_in_the', [$blockname, 'link_exact', '.modal-body', 'css_element']);
$this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'link_exact', '.modal-body', 'css_element']);
$this->execute('behat_general::should_not_exist_in_the', [$blockname, 'link_exact', $addblock, 'dialogue']);
$this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'button', $addblock, 'dialogue']);
}
}
......
......@@ -45,7 +45,7 @@ Feature: Edit user enrolment
And I am on "Course 1" course homepage
And I navigate to course participants
When I click on "Unenrol" "icon" in the "student1" "table_row"
And I click on "Unenrol" "button" in the ".modal-footer" "css_element"
And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
Then I should not see "Student 1" in the "participants" "table"
@javascript
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment