Guest User

Untitled

a guest
Jul 22nd, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. commit a4d0d2dd43d09b3d44031ce43165d4fad4078018
  2. Author: Pieter Frenssen <pieter@frenssen.be>
  3. Date: Sun Jul 22 15:42:02 2018 +0300
  4.  
  5. Revert "Fixed unwanted trailing tab in chrome 53 (#244)"
  6.  
  7. This reverts commit 67c5b8a20274c53ec2f85fabda7005a6ac2dd1b9.
  8.  
  9. diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php
  10. index cabdb60..0d54042 100755
  11. --- a/src/Selenium2Driver.php
  12. +++ b/src/Selenium2Driver.php
  13. @@ -679,11 +679,10 @@ JS;
  14. $existingValueLength = strlen($element->attribute('value'));
  15. // Add the TAB key to ensure we unfocus the field as browsers are triggering the change event only
  16. // after leaving the field.
  17. - $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value;
  18. + $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . Key::TAB;
  19. }
  20.  
  21. $element->postValue(array('value' => array($value)));
  22. - $this->trigger($xpath, 'change');
  23. }
  24.  
  25. /**
  26. @@ -837,7 +836,8 @@ JS;
  27. */
  28. public function focus($xpath)
  29. {
  30. - $this->trigger($xpath, 'focus');
  31. + $script = 'Syn.trigger("focus", {}, {{ELEMENT}})';
  32. + $this->withSyn()->executeJsOnXpath($xpath, $script);
  33. }
  34.  
  35. /**
  36. @@ -845,7 +845,8 @@ JS;
  37. */
  38. public function blur($xpath)
  39. {
  40. - $this->trigger($xpath, 'blur');
  41. + $script = 'Syn.trigger("blur", {}, {{ELEMENT}})';
  42. + $this->withSyn()->executeJsOnXpath($xpath, $script);
  43. }
  44.  
  45. /**
  46. @@ -854,7 +855,8 @@ JS;
  47. public function keyPress($xpath, $char, $modifier = null)
  48. {
  49. $options = self::charToOptions($char, $modifier);
  50. - $this->trigger($xpath, 'keypress', $options);
  51. + $script = "Syn.trigger('keypress', $options, {{ELEMENT}})";
  52. + $this->withSyn()->executeJsOnXpath($xpath, $script);
  53. }
  54.  
  55. /**
  56. @@ -863,7 +865,8 @@ JS;
  57. public function keyDown($xpath, $char, $modifier = null)
  58. {
  59. $options = self::charToOptions($char, $modifier);
  60. - $this->trigger($xpath, 'keydown', $options);
  61. + $script = "Syn.trigger('keydown', $options, {{ELEMENT}})";
  62. + $this->withSyn()->executeJsOnXpath($xpath, $script);
  63. }
  64.  
  65. /**
  66. @@ -872,7 +875,8 @@ JS;
  67. public function keyUp($xpath, $char, $modifier = null)
  68. {
  69. $options = self::charToOptions($char, $modifier);
  70. - $this->trigger($xpath, 'keyup', $options);
  71. + $script = "Syn.trigger('keyup', $options, {{ELEMENT}})";
  72. + $this->withSyn()->executeJsOnXpath($xpath, $script);
  73. }
  74.  
  75. /**
Add Comment
Please, Sign In to add comment