DriverCommand.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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\Remote;
  16. /**
  17. * This list of command defined in the WebDriver json wire protocol.
  18. */
  19. class DriverCommand
  20. {
  21. const GET_ALL_SESSIONS = 'getAllSessions';
  22. const GET_CAPABILITIES = 'getCapabilities';
  23. const NEW_SESSION = 'newSession';
  24. const STATUS = 'status';
  25. const CLOSE = 'close';
  26. const QUIT = 'quit';
  27. const GET = 'get';
  28. const GO_BACK = 'goBack';
  29. const GO_FORWARD = 'goForward';
  30. const REFRESH = 'refresh';
  31. const ADD_COOKIE = 'addCookie';
  32. const GET_ALL_COOKIES = 'getCookies';
  33. const DELETE_COOKIE = 'deleteCookie';
  34. const DELETE_ALL_COOKIES = 'deleteAllCookies';
  35. const FIND_ELEMENT = 'findElement';
  36. const FIND_ELEMENTS = 'findElements';
  37. const FIND_CHILD_ELEMENT = 'findChildElement';
  38. const FIND_CHILD_ELEMENTS = 'findChildElements';
  39. const CLEAR_ELEMENT = 'clearElement';
  40. const CLICK_ELEMENT = 'clickElement';
  41. const SEND_KEYS_TO_ELEMENT = 'sendKeysToElement';
  42. const SEND_KEYS_TO_ACTIVE_ELEMENT = 'sendKeysToActiveElement';
  43. const SUBMIT_ELEMENT = 'submitElement';
  44. const UPLOAD_FILE = 'uploadFile';
  45. const GET_CURRENT_WINDOW_HANDLE = 'getCurrentWindowHandle';
  46. const GET_WINDOW_HANDLES = 'getWindowHandles';
  47. const GET_CURRENT_CONTEXT_HANDLE = 'getCurrentContextHandle';
  48. const GET_CONTEXT_HANDLES = 'getContextHandles';
  49. // Switching between to window/frame/iframe
  50. const SWITCH_TO_WINDOW = 'switchToWindow';
  51. const SWITCH_TO_CONTEXT = 'switchToContext';
  52. const SWITCH_TO_FRAME = 'switchToFrame';
  53. const SWITCH_TO_PARENT_FRAME = 'switchToParentFrame';
  54. const GET_ACTIVE_ELEMENT = 'getActiveElement';
  55. // Information of the page
  56. const GET_CURRENT_URL = 'getCurrentUrl';
  57. const GET_PAGE_SOURCE = 'getPageSource';
  58. const GET_TITLE = 'getTitle';
  59. // Javascript API
  60. const EXECUTE_SCRIPT = 'executeScript';
  61. const EXECUTE_ASYNC_SCRIPT = 'executeAsyncScript';
  62. // API getting information from an element.
  63. const GET_ELEMENT_TEXT = 'getElementText';
  64. const GET_ELEMENT_TAG_NAME = 'getElementTagName';
  65. const IS_ELEMENT_SELECTED = 'isElementSelected';
  66. const IS_ELEMENT_ENABLED = 'isElementEnabled';
  67. const IS_ELEMENT_DISPLAYED = 'isElementDisplayed';
  68. const GET_ELEMENT_LOCATION = 'getElementLocation';
  69. const GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW = 'getElementLocationOnceScrolledIntoView';
  70. const GET_ELEMENT_SIZE = 'getElementSize';
  71. const GET_ELEMENT_ATTRIBUTE = 'getElementAttribute';
  72. const GET_ELEMENT_VALUE_OF_CSS_PROPERTY = 'getElementValueOfCssProperty';
  73. const ELEMENT_EQUALS = 'elementEquals';
  74. const SCREENSHOT = 'screenshot';
  75. // Alert API
  76. const ACCEPT_ALERT = 'acceptAlert';
  77. const DISMISS_ALERT = 'dismissAlert';
  78. const GET_ALERT_TEXT = 'getAlertText';
  79. const SET_ALERT_VALUE = 'setAlertValue';
  80. // Timeout API
  81. const SET_TIMEOUT = 'setTimeout';
  82. const IMPLICITLY_WAIT = 'implicitlyWait';
  83. const SET_SCRIPT_TIMEOUT = 'setScriptTimeout';
  84. const EXECUTE_SQL = 'executeSQL';
  85. const GET_LOCATION = 'getLocation';
  86. const SET_LOCATION = 'setLocation';
  87. const GET_APP_CACHE = 'getAppCache';
  88. const GET_APP_CACHE_STATUS = 'getStatus';
  89. const CLEAR_APP_CACHE = 'clearAppCache';
  90. const IS_BROWSER_ONLINE = 'isBrowserOnline';
  91. const SET_BROWSER_ONLINE = 'setBrowserOnline';
  92. const GET_LOCAL_STORAGE_ITEM = 'getLocalStorageItem';
  93. const GET_LOCAL_STORAGE_KEYS = 'getLocalStorageKeys';
  94. const SET_LOCAL_STORAGE_ITEM = 'setLocalStorageItem';
  95. const REMOVE_LOCAL_STORAGE_ITEM = 'removeLocalStorageItem';
  96. const CLEAR_LOCAL_STORAGE = 'clearLocalStorage';
  97. const GET_LOCAL_STORAGE_SIZE = 'getLocalStorageSize';
  98. const GET_SESSION_STORAGE_ITEM = 'getSessionStorageItem';
  99. const GET_SESSION_STORAGE_KEYS = 'getSessionStorageKey';
  100. const SET_SESSION_STORAGE_ITEM = 'setSessionStorageItem';
  101. const REMOVE_SESSION_STORAGE_ITEM = 'removeSessionStorageItem';
  102. const CLEAR_SESSION_STORAGE = 'clearSessionStorage';
  103. const GET_SESSION_STORAGE_SIZE = 'getSessionStorageSize';
  104. const SET_SCREEN_ORIENTATION = 'setScreenOrientation';
  105. const GET_SCREEN_ORIENTATION = 'getScreenOrientation';
  106. // These belong to the Advanced user interactions - an element is optional for these commands.
  107. const CLICK = 'mouseClick';
  108. const DOUBLE_CLICK = 'mouseDoubleClick';
  109. const MOUSE_DOWN = 'mouseButtonDown';
  110. const MOUSE_UP = 'mouseButtonUp';
  111. const MOVE_TO = 'mouseMoveTo';
  112. // Those allow interactions with the Input Methods installed on the system.
  113. const IME_GET_AVAILABLE_ENGINES = 'imeGetAvailableEngines';
  114. const IME_GET_ACTIVE_ENGINE = 'imeGetActiveEngine';
  115. const IME_IS_ACTIVATED = 'imeIsActivated';
  116. const IME_DEACTIVATE = 'imeDeactivate';
  117. const IME_ACTIVATE_ENGINE = 'imeActivateEngine';
  118. // These belong to the Advanced Touch API
  119. const TOUCH_SINGLE_TAP = 'touchSingleTap';
  120. const TOUCH_DOWN = 'touchDown';
  121. const TOUCH_UP = 'touchUp';
  122. const TOUCH_MOVE = 'touchMove';
  123. const TOUCH_SCROLL = 'touchScroll';
  124. const TOUCH_DOUBLE_TAP = 'touchDoubleTap';
  125. const TOUCH_LONG_PRESS = 'touchLongPress';
  126. const TOUCH_FLICK = 'touchFlick';
  127. // Window API (beta)
  128. const SET_WINDOW_SIZE = 'setWindowSize';
  129. const SET_WINDOW_POSITION = 'setWindowPosition';
  130. const GET_WINDOW_SIZE = 'getWindowSize';
  131. const GET_WINDOW_POSITION = 'getWindowPosition';
  132. const MAXIMIZE_WINDOW = 'maximizeWindow';
  133. // Logging API
  134. const GET_AVAILABLE_LOG_TYPES = 'getAvailableLogTypes';
  135. const GET_LOG = 'getLog';
  136. const GET_SESSION_LOGS = 'getSessionLogs';
  137. // Mobile API
  138. const GET_NETWORK_CONNECTION = 'getNetworkConnection';
  139. const SET_NETWORK_CONNECTION = 'setNetworkConnection';
  140. private function __construct()
  141. {
  142. }
  143. }