Touch.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Copyright 2011-2017 Anthon Pang. All Rights Reserved.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. * @package WebDriver
  18. *
  19. * @author Anthon Pang <apang@softwaredevelopment.ca>
  20. */
  21. namespace WebDriver;
  22. /**
  23. * WebDriver\Touch class
  24. *
  25. * @package WebDriver
  26. *
  27. * @method void click($jsonElement) Single tap on the touch enabled device.
  28. * @method void down($jsonCoordinates) Finger down on the screen.
  29. * @method void up($jsonCoordinates) Finger up on the screen.
  30. * @method void move($jsonCoordinates) Finger move on the screen.
  31. * @method void scroll($jsonCoordinates) Scroll on the touch screen using finger based motion events. Coordinates are either absolute, or relative to a element (if specified).
  32. * @method void doubleclick($jsonElement) Double tap on the touch screen using finger motion events.
  33. * @method void longclick($jsonElement) Long press on the touch screen using finger motion events.
  34. * @method void flick($json) Flick on the touch screen using finger motion events.
  35. */
  36. final class Touch extends AbstractWebDriver
  37. {
  38. /**
  39. * {@inheritdoc}
  40. */
  41. protected function methods()
  42. {
  43. return array(
  44. 'click' => array('POST'),
  45. 'down' => array('POST'),
  46. 'up' => array('POST'),
  47. 'move' => array('POST'),
  48. 'scroll' => array('POST'),
  49. 'doubleclick' => array('POST'),
  50. 'longclick' => array('POST'),
  51. 'flick' => array('POST'),
  52. );
  53. }
  54. }