DriverCommand.php 6.4 KB

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