Skip to content

[build] Remove features that are not w3c compliant #13372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions java/src/org/openqa/selenium/chromium/ChromiumDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,22 +302,26 @@ public SessionStorage getSessionStorage() {
}

@Override
@Deprecated
public Location location() {
return locationContext.location();
}

@Override
@Deprecated
public void setLocation(Location location) {
Require.nonNull("Location", location);
locationContext.setLocation(location);
}

@Override
@Deprecated
public ConnectionType getNetworkConnection() {
return networkConnection.getNetworkConnection();
}

@Override
@Deprecated
public ConnectionType setNetworkConnection(ConnectionType type) {
Require.nonNull("Network Connection Type", type);
return networkConnection.setNetworkConnection(type);
Expand Down
1 change: 1 addition & 0 deletions java/src/org/openqa/selenium/html5/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.openqa.selenium.html5;

/** Represents the physical location of the browser. */
@Deprecated
public class Location {

private final double latitude;
Expand Down
4 changes: 4 additions & 0 deletions java/src/org/openqa/selenium/html5/LocationContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

package org.openqa.selenium.html5;

/**
* @deprecated This functionality is no longer supported
*/
@Deprecated
public interface LocationContext {

/**
Expand Down
1 change: 1 addition & 0 deletions java/src/org/openqa/selenium/mobile/NetworkConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* }
* </pre>
*/
@Deprecated
public interface NetworkConnection {

/**
Expand Down
7 changes: 0 additions & 7 deletions java/src/org/openqa/selenium/remote/DriverCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
* @author jmleyba@gmail.com (Jason Leyba)
*/
public interface DriverCommand {
String GET_ALL_SESSIONS = "getAllSessions";
String GET_CAPABILITIES = "getCapabilities";
String NEW_SESSION = "newSession";
String STATUS = "status";
Expand Down Expand Up @@ -98,14 +97,12 @@ public interface DriverCommand {
String GET_ELEMENT_VALUE_OF_CSS_PROPERTY = "getElementValueOfCssProperty";
String GET_ELEMENT_ARIA_ROLE = "getElementAriaRole";
String GET_ELEMENT_ACCESSIBLE_NAME = "getElementAccessibleName";
String ELEMENT_EQUALS = "elementEquals";
String SCREENSHOT = "screenshot";
String ELEMENT_SCREENSHOT = "elementScreenshot";
String ACCEPT_ALERT = "acceptAlert";
String DISMISS_ALERT = "dismissAlert";
String GET_ALERT_TEXT = "getAlertText";
String SET_ALERT_VALUE = "setAlertValue";
String SET_ALERT_CREDENTIALS = "setAlertCredentials";
String GET_TIMEOUTS = "getTimeouts";
String SET_TIMEOUT = "setTimeout";
String PRINT_PAGE = "printPage";
Expand All @@ -114,10 +111,7 @@ public interface DriverCommand {
String GET_LOCATION = "getLocation";
String SET_LOCATION = "setLocation";
String GET_APP_CACHE = "getAppCache";
String GET_APP_CACHE_STATUS = "getStatus";
String CLEAR_APP_CACHE = "clearAppCache";
String IS_BROWSER_ONLINE = "isBrowserOnline";
String SET_BROWSER_ONLINE = "setBrowserOnline";
String GET_LOCAL_STORAGE_ITEM = "getLocalStorageItem";
String GET_LOCAL_STORAGE_KEYS = "getLocalStorageKeys";
String SET_LOCAL_STORAGE_ITEM = "setLocalStorageItem";
Expand Down Expand Up @@ -149,7 +143,6 @@ public interface DriverCommand {
// Logging API
String GET_AVAILABLE_LOG_TYPES = "getAvailableLogTypes";
String GET_LOG = "getLog";
String GET_SESSION_LOGS = "getSessionLogs";
// Mobile API
String GET_NETWORK_CONNECTION = "getNetworkConnection";
String SET_NETWORK_CONNECTION = "setNetworkConnection";
Expand Down
3 changes: 1 addition & 2 deletions java/src/org/openqa/selenium/remote/HttpCommandExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import static java.util.Collections.emptyMap;
import static org.openqa.selenium.json.Json.JSON_UTF_8;
import static org.openqa.selenium.remote.DriverCommand.GET_ALL_SESSIONS;
import static org.openqa.selenium.remote.DriverCommand.NEW_SESSION;
import static org.openqa.selenium.remote.DriverCommand.QUIT;
import static org.openqa.selenium.remote.HttpSessionId.getSessionId;
Expand Down Expand Up @@ -148,7 +147,7 @@ public Response execute(Command command) throws IOException {
if (QUIT.equals(command.getName())) {
return new Response();
}
if (!GET_ALL_SESSIONS.equals(command.getName()) && !NEW_SESSION.equals(command.getName())) {
if (!NEW_SESSION.equals(command.getName())) {
throw new NoSuchSessionException(
"Session ID is null. Using WebDriver after calling quit()?");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import static org.openqa.selenium.remote.DriverCommand.DELETE_COOKIE;
import static org.openqa.selenium.remote.DriverCommand.DELETE_DOWNLOADABLE_FILES;
import static org.openqa.selenium.remote.DriverCommand.DOWNLOAD_FILE;
import static org.openqa.selenium.remote.DriverCommand.ELEMENT_EQUALS;
import static org.openqa.selenium.remote.DriverCommand.ELEMENT_SCREENSHOT;
import static org.openqa.selenium.remote.DriverCommand.FIND_CHILD_ELEMENT;
import static org.openqa.selenium.remote.DriverCommand.FIND_CHILD_ELEMENTS;
Expand All @@ -41,36 +40,28 @@
import static org.openqa.selenium.remote.DriverCommand.GET;
import static org.openqa.selenium.remote.DriverCommand.GET_ACCOUNTS;
import static org.openqa.selenium.remote.DriverCommand.GET_ALL_COOKIES;
import static org.openqa.selenium.remote.DriverCommand.GET_ALL_SESSIONS;
import static org.openqa.selenium.remote.DriverCommand.GET_APP_CACHE_STATUS;
import static org.openqa.selenium.remote.DriverCommand.GET_AVAILABLE_LOG_TYPES;
import static org.openqa.selenium.remote.DriverCommand.GET_CAPABILITIES;
import static org.openqa.selenium.remote.DriverCommand.GET_CONTEXT_HANDLES;
import static org.openqa.selenium.remote.DriverCommand.GET_COOKIE;
import static org.openqa.selenium.remote.DriverCommand.GET_CREDENTIALS;
import static org.openqa.selenium.remote.DriverCommand.GET_CURRENT_CONTEXT_HANDLE;
import static org.openqa.selenium.remote.DriverCommand.GET_CURRENT_URL;
import static org.openqa.selenium.remote.DriverCommand.GET_DOWNLOADABLE_FILES;
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_LOCATION;
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_RECT;
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_SIZE;
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_TAG_NAME;
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_TEXT;
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_VALUE_OF_CSS_PROPERTY;
import static org.openqa.selenium.remote.DriverCommand.GET_FEDCM_DIALOG_TYPE;
import static org.openqa.selenium.remote.DriverCommand.GET_FEDCM_TITLE;
import static org.openqa.selenium.remote.DriverCommand.GET_LOCATION;
import static org.openqa.selenium.remote.DriverCommand.GET_LOG;
import static org.openqa.selenium.remote.DriverCommand.GET_NETWORK_CONNECTION;
import static org.openqa.selenium.remote.DriverCommand.GET_SCREEN_ORIENTATION;
import static org.openqa.selenium.remote.DriverCommand.GET_SCREEN_ROTATION;
import static org.openqa.selenium.remote.DriverCommand.GET_SESSION_LOGS;
import static org.openqa.selenium.remote.DriverCommand.GET_TIMEOUTS;
import static org.openqa.selenium.remote.DriverCommand.GET_TITLE;
import static org.openqa.selenium.remote.DriverCommand.GO_BACK;
import static org.openqa.selenium.remote.DriverCommand.GO_FORWARD;
import static org.openqa.selenium.remote.DriverCommand.IMPLICITLY_WAIT;
import static org.openqa.selenium.remote.DriverCommand.IS_BROWSER_ONLINE;
import static org.openqa.selenium.remote.DriverCommand.IS_ELEMENT_ENABLED;
import static org.openqa.selenium.remote.DriverCommand.IS_ELEMENT_SELECTED;
import static org.openqa.selenium.remote.DriverCommand.NEW_SESSION;
Expand All @@ -83,8 +74,6 @@
import static org.openqa.selenium.remote.DriverCommand.SCREENSHOT;
import static org.openqa.selenium.remote.DriverCommand.SELECT_ACCOUNT;
import static org.openqa.selenium.remote.DriverCommand.SEND_KEYS_TO_ELEMENT;
import static org.openqa.selenium.remote.DriverCommand.SET_ALERT_CREDENTIALS;
import static org.openqa.selenium.remote.DriverCommand.SET_BROWSER_ONLINE;
import static org.openqa.selenium.remote.DriverCommand.SET_DELAY_ENABLED;
import static org.openqa.selenium.remote.DriverCommand.SET_LOCATION;
import static org.openqa.selenium.remote.DriverCommand.SET_NETWORK_CONNECTION;
Expand Down Expand Up @@ -137,15 +126,10 @@ public AbstractHttpCommandCodec() {

String sessionId = "/session/:sessionId";

defineCommand(GET_ALL_SESSIONS, get("/sessions"));
defineCommand(NEW_SESSION, post("/session"));
defineCommand(GET_CAPABILITIES, get(sessionId));
defineCommand(QUIT, delete(sessionId));

defineCommand(GET_SESSION_LOGS, post("/logs"));
defineCommand(GET_LOG, post(sessionId + "/log"));
defineCommand(GET_AVAILABLE_LOG_TYPES, get(sessionId + "/log/types"));

defineCommand(SWITCH_TO_FRAME, post(sessionId + "/frame"));
defineCommand(SWITCH_TO_PARENT_FRAME, post(sessionId + "/frame/parent"));

Expand All @@ -161,8 +145,6 @@ public AbstractHttpCommandCodec() {
defineCommand(GO_FORWARD, post(sessionId + "/forward"));
defineCommand(REFRESH, post(sessionId + "/refresh"));

defineCommand(SET_ALERT_CREDENTIALS, post(sessionId + "/alert/credentials"));

defineCommand(SCREENSHOT, get(sessionId + "/screenshot"));
defineCommand(ELEMENT_SCREENSHOT, get(sessionId + "/element/:id/screenshot"));
defineCommand(GET_TITLE, get(sessionId + "/title"));
Expand All @@ -177,12 +159,9 @@ public AbstractHttpCommandCodec() {
defineCommand(FIND_CHILD_ELEMENT, post(elementId + "/element"));
defineCommand(FIND_CHILD_ELEMENTS, post(elementId + "/elements"));
defineCommand(IS_ELEMENT_ENABLED, get(elementId + "/enabled"));
defineCommand(ELEMENT_EQUALS, get(elementId + "/equals/:other"));
defineCommand(GET_ELEMENT_RECT, get(elementId + "/rect"));
defineCommand(GET_ELEMENT_LOCATION, get(elementId + "/location"));
defineCommand(GET_ELEMENT_TAG_NAME, get(elementId + "/name"));
defineCommand(IS_ELEMENT_SELECTED, get(elementId + "/selected"));
defineCommand(GET_ELEMENT_SIZE, get(elementId + "/size"));
defineCommand(GET_ELEMENT_TEXT, get(elementId + "/text"));
defineCommand(SEND_KEYS_TO_ELEMENT, post(elementId + "/value"));

Expand All @@ -199,23 +178,29 @@ public AbstractHttpCommandCodec() {
defineCommand(SET_SCRIPT_TIMEOUT, post(timeouts + "/async_script"));
defineCommand(IMPLICITLY_WAIT, post(timeouts + "/implicit_wait"));

defineCommand(GET_APP_CACHE_STATUS, get(sessionId + "/application_cache/status"));
defineCommand(IS_BROWSER_ONLINE, get(sessionId + "/browser_connection"));
defineCommand(SET_BROWSER_ONLINE, post(sessionId + "/browser_connection"));
defineCommand(GET_LOCATION, get(sessionId + "/location"));
defineCommand(SET_LOCATION, post(sessionId + "/location"));
defineCommand(
GET_LOCATION, get(sessionId + "/location")); // Not w3c; used in RemoteLocationContext
defineCommand(
SET_LOCATION, post(sessionId + "/location")); // Not w3c; used in RemoteLocationContext

defineCommand(GET_SCREEN_ORIENTATION, get(sessionId + "/orientation"));
defineCommand(SET_SCREEN_ORIENTATION, post(sessionId + "/orientation"));
defineCommand(GET_SCREEN_ROTATION, get(sessionId + "/rotation"));
defineCommand(SET_SCREEN_ROTATION, post(sessionId + "/rotation"));
defineCommand(
GET_SCREEN_ORIENTATION, get(sessionId + "/orientation")); // Not w3c; used in Appium
defineCommand(
SET_SCREEN_ORIENTATION, post(sessionId + "/orientation")); // Not w3c; used in Appium
defineCommand(GET_SCREEN_ROTATION, get(sessionId + "/rotation")); // Not w3c; used in Appium
defineCommand(SET_SCREEN_ROTATION, post(sessionId + "/rotation")); // Not w3c; used in Appium

// Mobile Spec
defineCommand(GET_NETWORK_CONNECTION, get(sessionId + "/network_connection"));
defineCommand(SET_NETWORK_CONNECTION, post(sessionId + "/network_connection"));
defineCommand(SWITCH_TO_CONTEXT, post(sessionId + "/context"));
defineCommand(GET_CURRENT_CONTEXT_HANDLE, get(sessionId + "/context"));
defineCommand(GET_CONTEXT_HANDLES, get(sessionId + "/contexts"));
defineCommand(
GET_NETWORK_CONNECTION,
get(sessionId + "/network_connection")); // Not w3c; used in RemoteNetworkConnection
defineCommand(
SET_NETWORK_CONNECTION,
post(sessionId + "/network_connection")); // Not w3c; used in RemoteNetworkConnection
defineCommand(SWITCH_TO_CONTEXT, post(sessionId + "/context")); // Not w3c; used in Appium
defineCommand(
GET_CURRENT_CONTEXT_HANDLE, get(sessionId + "/context")); // Not w3c; used in Appium
defineCommand(GET_CONTEXT_HANDLES, get(sessionId + "/contexts")); // Not w3c; used in Appium

// Virtual Authenticator API
String webauthn = sessionId + "/webauthn/authenticator";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
import org.openqa.selenium.remote.DriverCommand;
import org.openqa.selenium.remote.ExecuteMethod;

/**
* @deprecated This functionality is no longer supported
*/
@Deprecated
public class RemoteLocationContext implements LocationContext {
private final ExecuteMethod executeMethod;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
import org.openqa.selenium.remote.DriverCommand;
import org.openqa.selenium.remote.ExecuteMethod;

/**
* @deprecated This functionality is no longer supported
*/
@Deprecated
public class RemoteNetworkConnection implements NetworkConnection {

private final ExecuteMethod executeMethod;
Expand All @@ -31,12 +35,14 @@ public RemoteNetworkConnection(ExecuteMethod executeMethod) {
}

@Override
@Deprecated
public ConnectionType getNetworkConnection() {
return new ConnectionType(
((Number) executeMethod.execute(DriverCommand.GET_NETWORK_CONNECTION, null)).intValue());
}

@Override
@Deprecated
public ConnectionType setNetworkConnection(ConnectionType type) {
Map<String, ConnectionType> mode = Map.of("type", type);
return new ConnectionType(
Expand Down