MDL-48373 behat: find table columns better.

It was not possible to select the question bank 'Created by'
or 'Modified by' columns without this change.
This commit is contained in:
Tim Hunt 2014-12-01 20:00:10 +00:00
parent 4e4c8d3a27
commit dd2e1c222a

View File

@ -1039,9 +1039,9 @@ class behat_general extends behat_base {
} else {
// Header can be in thead or tbody (first row), following xpath should work.
$theadheaderxpath = "thead/tr[1]/th[(normalize-space(.)=" . $columnliteral . " or a[normalize-space(text())=" .
$columnliteral . "])]";
$columnliteral . "] or div[normalize-space(text())=" . $columnliteral . "])]";
$tbodyheaderxpath = "tbody/tr[1]/td[(normalize-space(.)=" . $columnliteral . " or a[normalize-space(text())=" .
$columnliteral . "])]";
$columnliteral . "] or div[normalize-space(text())=" . $columnliteral . "])]";
// Check if column exists.
$columnheaderxpath = $tablexpath . "[" . $theadheaderxpath . " | " . $tbodyheaderxpath . "]";