Verified Commit f2654188 authored by Jess's avatar Jess
Browse files

Issue #3327244 by alexpott, vijaycs85, Wim Leers: Regression: Testing non...

Issue #3327244 by alexpott, vijaycs85, Wim Leers: Regression: Testing non Drupal pages with WebdriverTestBase on 9.5 can be broken

(cherry picked from commit fe01fb7b)
parent e9200265
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -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() {
@@ -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;