MDL-50481 behat: Press go button for given single select in non-js

For non-js mode, ensure we press the go button
for the specified single select, as there can be
multiple single selects on the page with go button
This commit is contained in:
Rajesh Taneja
2015-06-19 12:00:11 +08:00
parent f4bfbd5aa2
commit bf4c3ee0ff
+6 -1
View File
@@ -394,7 +394,12 @@ class behat_forms extends behat_base {
);
if (!$this->running_javascript()) {
$actions[] = new Given('I press "' . get_string('go') . '"');
// Press button in the specified select container.
$containerxpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' singleselect ') and " .
".//label[contains(normalize-space(string(.)), '" . $singleselect . "')]]";
$actions[] = new Given('I click on "' . get_string('go') . '" "button" in the "' . $containerxpath .
'" "xpath_element"');
}
return $actions;