From afccc03f143ed058232a8e421ea70ed7b8a2770d Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Thu, 25 Feb 2016 13:39:33 +0800 Subject: [PATCH] MDL-46891 behat: Phantomjs require explicit change event It fails with multiple select while selecting group --- group/tests/behat/behat_groups.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/group/tests/behat/behat_groups.php b/group/tests/behat/behat_groups.php index 6ab66d8209f..daede1d5b7e 100644 --- a/group/tests/behat/behat_groups.php +++ b/group/tests/behat/behat_groups.php @@ -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();