MDL-50481 behat: SingleSelect can be urlselect and should support id/name

This commit is contained in:
Rajesh Taneja
2015-07-01 10:52:21 +08:00
parent b4d7038a88
commit bc7a59536b
+7 -2
View File
@@ -395,8 +395,13 @@ class behat_forms extends behat_base {
if (!$this->running_javascript()) {
// Press button in the specified select container.
$containerxpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' singleselect ') and " .
".//label[contains(normalize-space(string(.)), '" . $singleselect . "')]]";
$containerxpath = "//div[" .
"(contains(concat(' ', normalize-space(@class), ' '), ' singleselect ') " .
"or contains(concat(' ', normalize-space(@class), ' '), ' urlselect ')".
") and (
.//label[contains(normalize-space(string(.)), '" . $singleselect . "')] " .
"or .//select[(./@name='" . $singleselect . "' or ./@id='". $singleselect . "')]" .
")]";
$actions[] = new Given('I click on "' . get_string('go') . '" "button" in the "' . $containerxpath .
'" "xpath_element"');