DriverCommand.php 6.38 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
<?php
// Copyright 2004-present Facebook. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Facebook\WebDriver\Remote;

/**
 * This list of command defined in the WebDriver json wire protocol.
 *
 * @codeCoverageIgnore
 */
class DriverCommand
{
    const GET_ALL_SESSIONS = 'getAllSessions';
    const GET_CAPABILITIES = 'getCapabilities';
    const NEW_SESSION = 'newSession';
    const STATUS = 'status';
    const CLOSE = 'close';
    const QUIT = 'quit';
    const GET = 'get';
    const GO_BACK = 'goBack';
    const GO_FORWARD = 'goForward';
    const REFRESH = 'refresh';
    const ADD_COOKIE = 'addCookie';
    const GET_ALL_COOKIES = 'getCookies';
    const DELETE_COOKIE = 'deleteCookie';
    const DELETE_ALL_COOKIES = 'deleteAllCookies';
    const FIND_ELEMENT = 'findElement';
    const FIND_ELEMENTS = 'findElements';
    const FIND_CHILD_ELEMENT = 'findChildElement';
    const FIND_CHILD_ELEMENTS = 'findChildElements';
    const CLEAR_ELEMENT = 'clearElement';
    const CLICK_ELEMENT = 'clickElement';
    const SEND_KEYS_TO_ELEMENT = 'sendKeysToElement';
    const SEND_KEYS_TO_ACTIVE_ELEMENT = 'sendKeysToActiveElement';
    const SUBMIT_ELEMENT = 'submitElement';
    const UPLOAD_FILE = 'uploadFile';
    const GET_CURRENT_WINDOW_HANDLE = 'getCurrentWindowHandle';
    const GET_WINDOW_HANDLES = 'getWindowHandles';
    const GET_CURRENT_CONTEXT_HANDLE = 'getCurrentContextHandle';
    const GET_CONTEXT_HANDLES = 'getContextHandles';
    // Switching between to window/frame/iframe
    const SWITCH_TO_WINDOW = 'switchToWindow';
    const SWITCH_TO_CONTEXT = 'switchToContext';
    const SWITCH_TO_FRAME = 'switchToFrame';
    const SWITCH_TO_PARENT_FRAME = 'switchToParentFrame';
    const GET_ACTIVE_ELEMENT = 'getActiveElement';
    // Information of the page
    const GET_CURRENT_URL = 'getCurrentUrl';
    const GET_PAGE_SOURCE = 'getPageSource';
    const GET_TITLE = 'getTitle';
    // Javascript API
    const EXECUTE_SCRIPT = 'executeScript';
    const EXECUTE_ASYNC_SCRIPT = 'executeAsyncScript';
    // API getting information from an element.
    const GET_ELEMENT_TEXT = 'getElementText';
    const GET_ELEMENT_TAG_NAME = 'getElementTagName';
    const IS_ELEMENT_SELECTED = 'isElementSelected';
    const IS_ELEMENT_ENABLED = 'isElementEnabled';
    const IS_ELEMENT_DISPLAYED = 'isElementDisplayed';
    const GET_ELEMENT_LOCATION = 'getElementLocation';
    const GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW = 'getElementLocationOnceScrolledIntoView';
    const GET_ELEMENT_SIZE = 'getElementSize';
    const GET_ELEMENT_ATTRIBUTE = 'getElementAttribute';
    const GET_ELEMENT_VALUE_OF_CSS_PROPERTY = 'getElementValueOfCssProperty';
    const ELEMENT_EQUALS = 'elementEquals';
    const SCREENSHOT = 'screenshot';
    // Alert API
    const ACCEPT_ALERT = 'acceptAlert';
    const DISMISS_ALERT = 'dismissAlert';
    const GET_ALERT_TEXT = 'getAlertText';
    const SET_ALERT_VALUE = 'setAlertValue';
    // Timeout API
    const SET_TIMEOUT = 'setTimeout';
    const IMPLICITLY_WAIT = 'implicitlyWait';
    const SET_SCRIPT_TIMEOUT = 'setScriptTimeout';
    /** @deprecated */
    const EXECUTE_SQL = 'executeSQL';
    const GET_LOCATION = 'getLocation';
    const SET_LOCATION = 'setLocation';
    const GET_APP_CACHE = 'getAppCache';
    const GET_APP_CACHE_STATUS = 'getStatus';
    const CLEAR_APP_CACHE = 'clearAppCache';
    const IS_BROWSER_ONLINE = 'isBrowserOnline';
    const SET_BROWSER_ONLINE = 'setBrowserOnline';
    // Local storage
    const GET_LOCAL_STORAGE_ITEM = 'getLocalStorageItem';
    const GET_LOCAL_STORAGE_KEYS = 'getLocalStorageKeys';
    const SET_LOCAL_STORAGE_ITEM = 'setLocalStorageItem';
    const REMOVE_LOCAL_STORAGE_ITEM = 'removeLocalStorageItem';
    const CLEAR_LOCAL_STORAGE = 'clearLocalStorage';
    const GET_LOCAL_STORAGE_SIZE = 'getLocalStorageSize';
    // Session storage
    const GET_SESSION_STORAGE_ITEM = 'getSessionStorageItem';
    const GET_SESSION_STORAGE_KEYS = 'getSessionStorageKey';
    const SET_SESSION_STORAGE_ITEM = 'setSessionStorageItem';
    const REMOVE_SESSION_STORAGE_ITEM = 'removeSessionStorageItem';
    const CLEAR_SESSION_STORAGE = 'clearSessionStorage';
    const GET_SESSION_STORAGE_SIZE = 'getSessionStorageSize';
    // Screen orientation
    const SET_SCREEN_ORIENTATION = 'setScreenOrientation';
    const GET_SCREEN_ORIENTATION = 'getScreenOrientation';
    // These belong to the Advanced user interactions - an element is optional for these commands.
    const CLICK = 'mouseClick';
    const DOUBLE_CLICK = 'mouseDoubleClick';
    const MOUSE_DOWN = 'mouseButtonDown';
    const MOUSE_UP = 'mouseButtonUp';
    const MOVE_TO = 'mouseMoveTo';
    // Those allow interactions with the Input Methods installed on the system.
    const IME_GET_AVAILABLE_ENGINES = 'imeGetAvailableEngines';
    const IME_GET_ACTIVE_ENGINE = 'imeGetActiveEngine';
    const IME_IS_ACTIVATED = 'imeIsActivated';
    const IME_DEACTIVATE = 'imeDeactivate';
    const IME_ACTIVATE_ENGINE = 'imeActivateEngine';
    // These belong to the Advanced Touch API
    const TOUCH_SINGLE_TAP = 'touchSingleTap';
    const TOUCH_DOWN = 'touchDown';
    const TOUCH_UP = 'touchUp';
    const TOUCH_MOVE = 'touchMove';
    const TOUCH_SCROLL = 'touchScroll';
    const TOUCH_DOUBLE_TAP = 'touchDoubleTap';
    const TOUCH_LONG_PRESS = 'touchLongPress';
    const TOUCH_FLICK = 'touchFlick';
    // Window API (beta)
    const SET_WINDOW_SIZE = 'setWindowSize';
    const SET_WINDOW_POSITION = 'setWindowPosition';
    const GET_WINDOW_SIZE = 'getWindowSize';
    const GET_WINDOW_POSITION = 'getWindowPosition';
    const MAXIMIZE_WINDOW = 'maximizeWindow';
    // Logging API
    const GET_AVAILABLE_LOG_TYPES = 'getAvailableLogTypes';
    const GET_LOG = 'getLog';
    const GET_SESSION_LOGS = 'getSessionLogs';
    // Mobile API
    const GET_NETWORK_CONNECTION = 'getNetworkConnection';
    const SET_NETWORK_CONNECTION = 'setNetworkConnection';

    private function __construct()
    {
    }
}