From fe0f9adbe3508045f88fe5cb6c8ea5d4a10f3f6d Mon Sep 17 00:00:00 2001 From: David Monllao Date: Tue, 6 Aug 2013 14:43:56 +0800 Subject: [PATCH] MDL-40566 behat: Update features using the new options --- .../behat/tests/behat/basic_actions.feature | 4 +-- .../ui/tests/behat/backup_courses.feature | 7 ++-- .../tests/behat/view_my_courses.feature | 34 +++++++++---------- course/tests/behat/course_controls.feature | 8 ++--- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/admin/tool/behat/tests/behat/basic_actions.feature b/admin/tool/behat/tests/behat/basic_actions.feature index 637086f20a8..4ec803d8e21 100644 --- a/admin/tool/behat/tests/behat/basic_actions.feature +++ b/admin/tool/behat/tests/behat/basic_actions.feature @@ -35,7 +35,7 @@ Feature: Page contents assertions | Course 1 | C1 | 0 | And I log in as "admin" And I follow "Course 1" - When I click on "Move this to the dock" "button" in the ".block_settings" "css_element" + When I click on "Move this to the dock" "button" in the "Administration" "block" Then I should not see "Question bank" And I click on "//div[@id='dock']/descendant::h2[normalize-space(.)='Administration']" "xpath_element" @@ -45,5 +45,5 @@ Feature: Page contents assertions | fullname | shortname | category | | Course 1 | C1 | 0 | And I log in as "admin" - When I click on "Move this to the dock" "button" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' block_settings ')]" "xpath_element" + When I click on "Move this to the dock" "button" in the "Administration" "block" Then I should not see "Turn editing on" diff --git a/backup/util/ui/tests/behat/backup_courses.feature b/backup/util/ui/tests/behat/backup_courses.feature index f8b85d75f0b..67321949996 100644 --- a/backup/util/ui/tests/behat/backup_courses.feature +++ b/backup/util/ui/tests/behat/backup_courses.feature @@ -13,8 +13,9 @@ Feature: Backup Moodle courses @javascript Scenario: Backup a course providing options When I backup "Course 1" course using this options: + | Filename | test_backup.mbz | Then I should see "Restore" - And I click on "Restore" "link" in the ".backup-files-table" "css_element" + And I click on "Restore" "link" in the "test_backup.mbz" "table_row" And I should see "URL of backup" And I should see "Anonymize user information" @@ -27,11 +28,11 @@ Feature: Backup Moodle courses | setting_section_section_5_userinfo | 0 | | setting_section_section_5_included | 0 | Then I should see "Restore" - And I click on "Restore" "link" in the ".backup-files-table" "css_element" + And I click on "Restore" "link" in the "test_backup.mbz" "table_row" And I should not see "Section 3" And I press "Continue" And I click on "Continue" "button" in the ".bcs-current-course" "css_element" And "//div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')][contains(., 'Include calendar events')]/descendant::img" "xpath_element" should exists And I check "Include course logs" And I press "Cancel" - And I click on "Cancel" "button" in the ".confirmation-dialogue" "css_element" + And I click on "Cancel" "button" in the "Cancel backup" "dialogue" diff --git a/blocks/navigation/tests/behat/view_my_courses.feature b/blocks/navigation/tests/behat/view_my_courses.feature index 567250b0e4d..6287bad3d15 100644 --- a/blocks/navigation/tests/behat/view_my_courses.feature +++ b/blocks/navigation/tests/behat/view_my_courses.feature @@ -38,14 +38,14 @@ Feature: View my courses in navigation block And I log out And I log in as "student1" When I follow "My home" - Then I should not see "cat1" in the "div.block_navigation .type_system" "css_element" - And I should not see "cat2" in the "div.block_navigation .type_system" "css_element" - And I should see "c1" in the "div.block_navigation .type_system" "css_element" - And I should see "c31" in the "div.block_navigation .type_system" "css_element" - And I should see "c331" in the "div.block_navigation .type_system" "css_element" - And I should not see "c2" in the "div.block_navigation .type_system" "css_element" - And I should not see "c32" in the "div.block_navigation .type_system" "css_element" - And I should not see "c332" in the "div.block_navigation .type_system" "css_element" + Then I should not see "cat1" in the "Navigation" "block" + And I should not see "cat2" in the "Navigation" "block" + And I should see "c1" in the "Navigation" "block" + And I should see "c31" in the "Navigation" "block" + And I should see "c331" in the "Navigation" "block" + And I should not see "c2" in the "Navigation" "block" + And I should not see "c32" in the "Navigation" "block" + And I should not see "c332" in the "Navigation" "block" @javascript Scenario: The nested list of enrolled courses is shown @@ -54,18 +54,18 @@ Feature: View my courses in navigation block And I log out And I log in as "student1" When I follow "My home" - Then I should see "cat1" in the "div.block_navigation .type_system" "css_element" - And I should see "cat3" in the "div.block_navigation .type_system" "css_element" - And I should not see "cat2" in the "div.block_navigation .type_system" "css_element" + Then I should see "cat1" in the "Navigation" "block" + And I should see "cat3" in the "Navigation" "block" + And I should not see "cat2" in the "Navigation" "block" And I expand "cat3" node And I wait "2" seconds - And I should see "cat31" in the "div.block_navigation .type_system" "css_element" - And I should see "cat33" in the "div.block_navigation .type_system" "css_element" - And I should not see "cat32" in the "div.block_navigation .type_system" "css_element" + And I should see "cat31" in the "Navigation" "block" + And I should see "cat33" in the "Navigation" "block" + And I should not see "cat32" in the "Navigation" "block" And I expand "cat31" node And I wait "2" seconds - And I should see "c31" in the "div.block_navigation .type_system" "css_element" + And I should see "c31" in the "Navigation" "block" And I expand "cat33" node And I wait "2" seconds - And I should see "c331" in the "div.block_navigation .type_system" "css_element" - And I should not see "c332" in the "div.block_navigation .type_system" "css_element" + And I should see "c331" in the "Navigation" "block" + And I should not see "c332" in the "Navigation" "block" diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature index 973c2878904..371fa37ea91 100644 --- a/course/tests/behat/course_controls.feature +++ b/course/tests/behat/course_controls.feature @@ -74,8 +74,8 @@ Feature: Course activity controls works as expected And section "1" should be visible And I add the "Section links" block And "#section-2" "css_element" exists - And I should see "1 2 3 4 5" in the ".block_section_links" "css_element" - And I click on "2" "link" in the ".block_section_links" "css_element" + And I should see "1 2 3 4 5" in the "Section links" "block" + And I click on "2" "link" in the "Section links" "block" And I see "Test forum name 2" Examples: @@ -148,8 +148,8 @@ Feature: Course activity controls works as expected And section "1" should be visible And I add the "Section links" block And "#section-2" "css_element" exists - And I should see "1 2 3 4 5" in the ".block_section_links" "css_element" - And I click on "2" "link" in the ".block_section_links" "css_element" + And I should see "1 2 3 4 5" in the "Section links" "block" + And I click on "2" "link" in the "Section links" "block" And I see "Test forum name 2" Examples: