Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit a4d0d2dd43d09b3d44031ce43165d4fad4078018
- Author: Pieter Frenssen <pieter@frenssen.be>
- Date: Sun Jul 22 15:42:02 2018 +0300
- Revert "Fixed unwanted trailing tab in chrome 53 (#244)"
- This reverts commit 67c5b8a20274c53ec2f85fabda7005a6ac2dd1b9.
- diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php
- index cabdb60..0d54042 100755
- --- a/src/Selenium2Driver.php
- +++ b/src/Selenium2Driver.php
- @@ -679,11 +679,10 @@ JS;
- $existingValueLength = strlen($element->attribute('value'));
- // Add the TAB key to ensure we unfocus the field as browsers are triggering the change event only
- // after leaving the field.
- - $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value;
- + $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . Key::TAB;
- }
- $element->postValue(array('value' => array($value)));
- - $this->trigger($xpath, 'change');
- }
- /**
- @@ -837,7 +836,8 @@ JS;
- */
- public function focus($xpath)
- {
- - $this->trigger($xpath, 'focus');
- + $script = 'Syn.trigger("focus", {}, {{ELEMENT}})';
- + $this->withSyn()->executeJsOnXpath($xpath, $script);
- }
- /**
- @@ -845,7 +845,8 @@ JS;
- */
- public function blur($xpath)
- {
- - $this->trigger($xpath, 'blur');
- + $script = 'Syn.trigger("blur", {}, {{ELEMENT}})';
- + $this->withSyn()->executeJsOnXpath($xpath, $script);
- }
- /**
- @@ -854,7 +855,8 @@ JS;
- public function keyPress($xpath, $char, $modifier = null)
- {
- $options = self::charToOptions($char, $modifier);
- - $this->trigger($xpath, 'keypress', $options);
- + $script = "Syn.trigger('keypress', $options, {{ELEMENT}})";
- + $this->withSyn()->executeJsOnXpath($xpath, $script);
- }
- /**
- @@ -863,7 +865,8 @@ JS;
- public function keyDown($xpath, $char, $modifier = null)
- {
- $options = self::charToOptions($char, $modifier);
- - $this->trigger($xpath, 'keydown', $options);
- + $script = "Syn.trigger('keydown', $options, {{ELEMENT}})";
- + $this->withSyn()->executeJsOnXpath($xpath, $script);
- }
- /**
- @@ -872,7 +875,8 @@ JS;
- public function keyUp($xpath, $char, $modifier = null)
- {
- $options = self::charToOptions($char, $modifier);
- - $this->trigger($xpath, 'keyup', $options);
- + $script = "Syn.trigger('keyup', $options, {{ELEMENT}})";
- + $this->withSyn()->executeJsOnXpath($xpath, $script);
- }
- /**
Add Comment
Please, Sign In to add comment