Commit 0996a296 authored by Rajesh Taneja's avatar Rajesh Taneja Committed by David Monllaó
Browse files

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

parent c556c5fc
......@@ -381,8 +381,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"');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment