MDL-51988 behat: select a table by <th> tag
authorDan Poltawski <dan@moodle.com>
Wed, 11 Nov 2015 12:17:21 +0000 (12:17 +0000)
committerDan Poltawski <dan@moodle.com>
Wed, 11 Nov 2015 12:30:35 +0000 (12:30 +0000)
lib/behat/classes/behat_selectors.php

index add2130..4b85386 100644 (file)
@@ -131,7 +131,7 @@ XPATH
     [./descendant::*[self::h2][normalize-space(.) = %locator%] or %locator% = 'frontpage']
 XPATH
         , 'table' => <<<XPATH
-.//table[(./@id = %locator% or contains(.//caption, %locator%) or contains(concat(' ', normalize-space(@class), ' '), %locator% ))]
+.//table[(./@id = %locator% or contains(.//caption, %locator%) or contains(.//th, %locator%) or contains(concat(' ', normalize-space(@class), ' '), %locator% ))]
 XPATH
         , 'table_row' => <<<XPATH
 .//tr[contains(normalize-space(.), %locator%) and not(.//tr[contains(normalize-space(.), %locator%)])]