MDL-46891 behat: Phantomjs require explicit change event

It fails with multiple select while selecting group
This commit is contained in:
Rajesh Taneja 2016-02-25 13:39:33 +08:00
parent 0f3fba7d66
commit afccc03f14

View File

@ -62,6 +62,11 @@ class behat_groups extends behat_base {
$fulloption = $groupoption->getText();
$select->selectOption($fulloption);
// This is needed by some drivers to ensure relevant event is triggred and button is enabled.
$script = "Syn.trigger('change', {}, {{ELEMENT}})";
$this->getSession()->getDriver()->triggerSynScript($select->getXpath(), $script);
$this->getSession()->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS);
// Here we don't need to wait for the AJAX response.
$this->find_button(get_string('adduserstogroup', 'group'))->click();