From 5df9e40cecaf411bb17e3a82c42a1985d6ef87a7 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 5 Aug 2013 13:02:06 +0800 Subject: [PATCH] MDL-40741 behat: Changing xpaths for clean theme Keeps compatibility with standard theme. --- admin/tool/behat/tests/behat/basic_actions.feature | 6 +++--- admin/tool/behat/tests/behat/manipulate_forms.feature | 2 +- blocks/tests/behat/configure_block_throughout_site.feature | 2 +- blocks/tests/behat/manage_blocks.feature | 2 +- course/tests/behat/course_controls.feature | 2 +- lib/behat/classes/behat_selectors.php | 2 +- mod/wiki/tests/behat/page_history.feature | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/admin/tool/behat/tests/behat/basic_actions.feature b/admin/tool/behat/tests/behat/basic_actions.feature index c5dc2760250..5b1bd502260 100644 --- a/admin/tool/behat/tests/behat/basic_actions.feature +++ b/admin/tool/behat/tests/behat/basic_actions.feature @@ -18,7 +18,7 @@ Feature: Page contents assertions When I follow "Overview" And I wait until the page is ready And I wait "2" seconds - And I hover ".region-content .generaltable td span" "css_element" + And I hover "#region-main .generaltable td span" "css_element" Then I should see "I'm the description" And "Grouping" "select" in the "region-main" "region" should be visible And "Group" "select" should be visible @@ -26,8 +26,8 @@ Feature: Page contents assertions And "Change password" "link" should not be visible And I should see "Filter groups by" And I should not see "Filter groupssss by" - And I should see "Group members" in the ".region-content table th.c1" "css_element" - And I should not see "Group membersssss" in the ".region-content table th.c1" "css_element" + And I should see "Group members" in the "#region-main table th.c1" "css_element" + And I should not see "Group membersssss" in the "#region-main table th.c1" "css_element" And I follow "Groups" And the "#groupeditform #showcreateorphangroupform" "css_element" should be enabled And the "#groupeditform #showeditgroupsettingsform" "css_element" should be disabled diff --git a/admin/tool/behat/tests/behat/manipulate_forms.feature b/admin/tool/behat/tests/behat/manipulate_forms.feature index 9aa1c88ae60..664bbd67a69 100644 --- a/admin/tool/behat/tests/behat/manipulate_forms.feature +++ b/admin/tool/behat/tests/behat/manipulate_forms.feature @@ -32,5 +32,5 @@ Feature: Forms manipulation Then I should see "Close the quiz" And I should see "Group mode" And I should see "Grouping" - And I should not see "Show more..." in the "region-main-box" "region" + And I should not see "Show more..." in the "region-main" "region" And I should see "Show less..." diff --git a/blocks/tests/behat/configure_block_throughout_site.feature b/blocks/tests/behat/configure_block_throughout_site.feature index bc1c316aa48..3812f69ab78 100644 --- a/blocks/tests/behat/configure_block_throughout_site.feature +++ b/blocks/tests/behat/configure_block_throughout_site.feature @@ -34,4 +34,4 @@ Feature: Add and configure blocks throughout the site And I press "Save changes" And I follow "Course 1" # The first block matching the pattern should be top-left block - And I should see "Comments" in the "//*[@id='region-pre']/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]" "xpath_element" + And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]" "xpath_element" diff --git a/blocks/tests/behat/manage_blocks.feature b/blocks/tests/behat/manage_blocks.feature index dea4dccfd8c..5f1189dab27 100644 --- a/blocks/tests/behat/manage_blocks.feature +++ b/blocks/tests/behat/manage_blocks.feature @@ -81,4 +81,4 @@ Feature: Block appearances | Visible | Yes | | Region | Right | And I press "Save changes" - And I should see "Comments" in the "#region-post" "css_element" + And I should see "Comments" in the "//*[@id='region-post' or @id='block-region-side-post']" "xpath_element" diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature index 283346e2bd5..87adb974ed9 100644 --- a/course/tests/behat/course_controls.feature +++ b/course/tests/behat/course_controls.feature @@ -137,7 +137,7 @@ Feature: Course activity controls works as expected And "#section-2" "css_element" exists And I delete "Test forum name 1" activity And "#section-2" "css_element" exists - And I should not see "Test forum name 1" in the ".region-content" "css_element" + And I should not see "Test forum name 1" in the "#region-main" "css_element" And I duplicate "Test forum name 2" activity editing the new copy with: | Forum name | Edited test forum name 2 | And "#section-2" "css_element" exists diff --git a/lib/behat/classes/behat_selectors.php b/lib/behat/classes/behat_selectors.php index e92131de93b..b0153d924cb 100644 --- a/lib/behat/classes/behat_selectors.php +++ b/lib/behat/classes/behat_selectors.php @@ -89,7 +89,7 @@ XPATH .//div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' '))] | .//div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]/descendant::h2[normalize-space(.) = %locator%]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')] XPATH , 'region' => << <<