Skip to content

Commit

Permalink
MDL-59882 behat: Update known uses of dialogue CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Oct 2, 2017
1 parent 434d786 commit 2a77813
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions calendar/tests/behat/calendar.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion enrol/meta/tests/behat/enrol_meta.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion enrol/self/tests/behat/self_enrolment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion message/tests/behat/delete_all_messages.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 11 additions & 8 deletions theme/boost/tests/behat/behat_theme_boost_behat_blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
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']);
}
}

Expand All @@ -66,28 +67,30 @@ public function i_open_the_blocks_action_menu($blockname) {
}

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']);
}
}

Expand Down
2 changes: 1 addition & 1 deletion user/tests/behat/edit_user_enrolment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a77813

Please sign in to comment.