Loading core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php +16 −13 Original line number Diff line number Diff line Loading @@ -145,8 +145,10 @@ public function setValue($xpath, $value) { // \Behat\Mink\Driver\Selenium2Driver::setValue() will call .blur() on // the element, modify that to trigger the "input" and "change" events // instead. They indicate the value has changed, rather than implying // user focus changes. // user focus changes. This script only runs when Drupal javascript has // been loaded. $this->executeJsOnXpath($xpath, <<<JS if (typeof Drupal !== 'undefined') { var node = {{ELEMENT}}; var original = node.blur; node.blur = function() { Loading @@ -159,6 +161,7 @@ public function setValue($xpath, $value) { node.dispatchEvent(new Event("formUpdated", {bubbles:true})); node.blur = original; }; } JS); parent::setValue($xpath, $value); return TRUE; Loading Loading
core/tests/Drupal/FunctionalJavascriptTests/DrupalSelenium2Driver.php +16 −13 Original line number Diff line number Diff line Loading @@ -145,8 +145,10 @@ public function setValue($xpath, $value) { // \Behat\Mink\Driver\Selenium2Driver::setValue() will call .blur() on // the element, modify that to trigger the "input" and "change" events // instead. They indicate the value has changed, rather than implying // user focus changes. // user focus changes. This script only runs when Drupal javascript has // been loaded. $this->executeJsOnXpath($xpath, <<<JS if (typeof Drupal !== 'undefined') { var node = {{ELEMENT}}; var original = node.blur; node.blur = function() { Loading @@ -159,6 +161,7 @@ public function setValue($xpath, $value) { node.dispatchEvent(new Event("formUpdated", {bubbles:true})); node.blur = original; }; } JS); parent::setValue($xpath, $value); return TRUE; Loading