MDL-40741 behat: Changing xpaths for clean theme
authorDavid Monllao <davidm@moodle.com>
Mon, 5 Aug 2013 05:02:06 +0000 (13:02 +0800)
committerDavid Monllao <davidm@moodle.com>
Tue, 26 Nov 2013 03:41:13 +0000 (11:41 +0800)
Keeps compatibility with standard theme.

admin/tool/behat/tests/behat/basic_actions.feature
admin/tool/behat/tests/behat/manipulate_forms.feature
blocks/tests/behat/configure_block_throughout_site.feature
blocks/tests/behat/manage_blocks.feature
course/tests/behat/course_controls.feature
lib/behat/classes/behat_selectors.php
mod/wiki/tests/behat/page_history.feature

index c5dc276..5b1bd50 100644 (file)
@@ -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
index 9aa1c88..664bbd6 100644 (file)
@@ -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..."
index bc1c316..3812f69 100644 (file)
@@ -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"
index dea4dcc..5f1189d 100644 (file)
@@ -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"
index 283346e..87adb97 100644 (file)
@@ -137,7 +137,7 @@ Feature: Course activity controls works as expected
     And "#section-2" "css_element" <should_see_other_sections> exists
     And I delete "Test forum name 1" activity
     And "#section-2" "css_element" <should_see_other_sections> 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" <should_see_other_sections> exists
index e92131d..b0153d9 100644 (file)
@@ -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' => <<<XPATH
-.//div[./@id = %locator%]
+.//*[self::div | self::section | self::aside][./@id = %locator%]
 XPATH
         , 'table_row' => <<<XPATH
 .//tr[contains(normalize-space(.), %locator%)]
index 7bb0426..2cac108 100644 (file)
@@ -50,7 +50,7 @@ Feature: A history of each wiki page is available
     And I press "Save"
     And I follow "History"
     # Checking that there are 3 history items (the first one is are th)
-    And "//div[@class='region-content']/descendant::table/descendant::tr[4]" "xpath_element" should exists
+    And "//*[@id='region-main']/descendant::table/descendant::tr[4]" "xpath_element" should exists
     And I click on "1" "link" in the "Teacher 1" table row
     And I should see "First edition"
     And I should see "Teacher 1"
@@ -61,7 +61,7 @@ Feature: A history of each wiki page is available
     And I follow "History"
     And I click on "3" "link" in the "Student 2" table row
     And I should see "Third edition"
-    And I should see "Student 2" in the ".region-content" "css_element"
+    And I should see "Student 2" in the "#region-main" "css_element"
     And I follow "History"
     And I click on "comparewith" "radio" in the "Student 1" table row
     And I click on "compare" "radio" in the "Teacher 1" table row