WebDriverTouchScreen.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. // Copyright 2004-present Facebook. All Rights Reserved.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. namespace Facebook\WebDriver\Interactions\Touch;
  16. use Facebook\WebDriver\WebDriverElement;
  17. /**
  18. * Interface representing touch screen operations.
  19. */
  20. interface WebDriverTouchScreen
  21. {
  22. /**
  23. * Single tap on the touch enabled device.
  24. *
  25. * @param WebDriverElement $element
  26. * @return $this
  27. */
  28. public function tap(WebDriverElement $element);
  29. /**
  30. * Double tap on the touch screen using finger motion events.
  31. *
  32. * @param WebDriverElement $element
  33. * @return $this
  34. */
  35. public function doubleTap(WebDriverElement $element);
  36. /**
  37. * Finger down on the screen.
  38. *
  39. * @param int $x
  40. * @param int $y
  41. * @return $this
  42. */
  43. public function down($x, $y);
  44. /**
  45. * Flick on the touch screen using finger motion events. Use this flick
  46. * command if you don't care where the flick starts on the screen.
  47. *
  48. * @param int $xspeed
  49. * @param int $yspeed
  50. * @return $this
  51. */
  52. public function flick($xspeed, $yspeed);
  53. /**
  54. * Flick on the touch screen using finger motion events.
  55. * This flickcommand starts at a particular screen location.
  56. *
  57. * @param WebDriverElement $element
  58. * @param int $xoffset
  59. * @param int $yoffset
  60. * @param int $speed
  61. * @return $this
  62. */
  63. public function flickFromElement(
  64. WebDriverElement $element,
  65. $xoffset,
  66. $yoffset,
  67. $speed
  68. );
  69. /**
  70. * Long press on the touch screen using finger motion events.
  71. *
  72. * @param WebDriverElement $element
  73. * @return $this
  74. */
  75. public function longPress(WebDriverElement $element);
  76. /**
  77. * Finger move on the screen.
  78. *
  79. * @param int $x
  80. * @param int $y
  81. * @return $this
  82. */
  83. public function move($x, $y);
  84. /**
  85. * Scroll on the touch screen using finger based motion events. Use this
  86. * command if you don't care where the scroll starts on the screen.
  87. *
  88. * @param int $xoffset
  89. * @param int $yoffset
  90. * @return $this
  91. */
  92. public function scroll($xoffset, $yoffset);
  93. /**
  94. * Scroll on the touch screen using finger based motion events. Use this
  95. * command to start scrolling at a particular screen location.
  96. *
  97. * @param WebDriverElement $element
  98. * @param int $xoffset
  99. * @param int $yoffset
  100. * @return $this
  101. */
  102. public function scrollFromElement(
  103. WebDriverElement $element,
  104. $xoffset,
  105. $yoffset
  106. );
  107. /**
  108. * Finger up on the screen.
  109. *
  110. * @param int $x
  111. * @param int $y
  112. * @return $this
  113. */
  114. public function up($x, $y);
  115. }