Skip to content

Commit 348f17b

Browse files
committed
[java] Deprecating non W3C caps and Augmenters using them
1 parent 69f6a3f commit 348f17b

File tree

8 files changed

+148
-17
lines changed

8 files changed

+148
-17
lines changed

java/src/org/openqa/selenium/Rotatable.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
package org.openqa.selenium;
1919

2020
/**
21+
* @deprecated As this is only available only for mobile which is handled by the Appium project
22+
*
2123
* Represents rotation of the browser view for orientation-sensitive devices.
2224
*
2325
* When using this with a real device, the device should not be moved so that the built-in sensors
2426
* do not interfere.
2527
*/
28+
@Deprecated
2629
public interface Rotatable {
2730

2831
/**
@@ -36,15 +39,15 @@ public interface Rotatable {
3639
* @return the current screen orientation of the browser
3740
*/
3841
ScreenOrientation getOrientation();
39-
42+
4043
/**
4144
* Changes the rotation of the browser window.
4245
*/
4346
void rotate(DeviceRotation rotation);
44-
47+
4548
/**
4649
* @return DeviceOrientation describing the current screen rotation of the browser window
4750
*/
4851
DeviceRotation rotation();
49-
52+
5053
}

java/src/org/openqa/selenium/remote/AddRotatable.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
import static org.openqa.selenium.remote.CapabilityType.ROTATABLE;
2626

27+
/**
28+
* @deprecated Uses a non W3C compliant capability and is not available in W3C WebDriver sessions
29+
*/
30+
@Deprecated
2731
public class AddRotatable implements AugmenterProvider<Rotatable> {
2832

2933
@Override

java/src/org/openqa/selenium/remote/CapabilityType.java

Lines changed: 111 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,53 +22,156 @@
2222
*/
2323
public interface CapabilityType {
2424

25-
String BROWSER_NAME = "browserName";
2625
/**
2726
* @deprecated Use {@link CapabilityType#PLATFORM_NAME}
2827
*/
2928
@Deprecated
3029
String PLATFORM = "platform";
31-
String PLATFORM_NAME = "platformName";
30+
/**
31+
* @deprecated Non W3C compliant
32+
*/
33+
@Deprecated
3234
String SUPPORTS_JAVASCRIPT = "javascriptEnabled";
35+
/**
36+
* @deprecated Non W3C compliant
37+
*/
38+
@Deprecated
3339
String TAKES_SCREENSHOT = "takesScreenshot";
3440
/**
3541
* @deprecated Use {@link CapabilityType#BROWSER_VERSION}
3642
*/
3743
@Deprecated
3844
String VERSION = "version";
39-
String BROWSER_VERSION = "browserVersion";
45+
/**
46+
* @deprecated Use {@link CapabilityType#UNHANDLED_PROMPT_BEHAVIOUR}
47+
*/
48+
@Deprecated
4049
String SUPPORTS_ALERTS = "handlesAlerts";
50+
/**
51+
* @deprecated Non W3C compliant
52+
*/
53+
@Deprecated
4154
String SUPPORTS_SQL_DATABASE = "databaseEnabled";
55+
/**
56+
* @deprecated Non W3C compliant
57+
*/
58+
@Deprecated
4259
String SUPPORTS_LOCATION_CONTEXT = "locationContextEnabled";
60+
/**
61+
* @deprecated Non W3C compliant
62+
*/
63+
@Deprecated
4364
String SUPPORTS_APPLICATION_CACHE = "applicationCacheEnabled";
65+
/**
66+
* @deprecated Non W3C compliant
67+
*/
68+
@Deprecated
4469
String SUPPORTS_NETWORK_CONNECTION = "networkConnectionEnabled";
45-
String PROXY = "proxy";
70+
/**
71+
* @deprecated Non W3C compliant
72+
*/
73+
@Deprecated
4674
String SUPPORTS_WEB_STORAGE = "webStorageEnabled";
75+
/**
76+
* @deprecated Non W3C compliant
77+
*/
78+
@Deprecated
4779
String ROTATABLE = "rotatable";
80+
/**
81+
* @deprecated Non W3C compliant
82+
*/
83+
@Deprecated
4884
String APPLICATION_NAME = "applicationName";
49-
// Enable this capability to accept all SSL certs by defaults.
85+
/**
86+
* @deprecated Use {@link CapabilityType#ACCEPT_INSECURE_CERTS}
87+
*/
88+
@Deprecated
5089
String ACCEPT_SSL_CERTS = "acceptSslCerts";
51-
String ACCEPT_INSECURE_CERTS = "acceptInsecureCerts";
90+
/**
91+
* @deprecated Non W3C compliant
92+
*/
93+
@Deprecated
5294
String HAS_NATIVE_EVENTS = "nativeEvents";
95+
/**
96+
* @deprecated Use {@link CapabilityType#UNHANDLED_PROMPT_BEHAVIOUR}
97+
*/
98+
@Deprecated
5399
String UNEXPECTED_ALERT_BEHAVIOUR = "unexpectedAlertBehaviour";
54-
String UNHANDLED_PROMPT_BEHAVIOUR = "unhandledPromptBehavior";
100+
/**
101+
* @deprecated Non W3C compliant
102+
*/
103+
@Deprecated
55104
String ELEMENT_SCROLL_BEHAVIOR = "elementScrollBehavior";
105+
/**
106+
* @deprecated Non W3C compliant
107+
*/
108+
@Deprecated
56109
String HAS_TOUCHSCREEN = "hasTouchScreen";
110+
/**
111+
* @deprecated Non W3C compliant
112+
*/
113+
@Deprecated
57114
String OVERLAPPING_CHECK_DISABLED = "overlappingCheckDisabled";
115+
/**
116+
* @deprecated Non W3C compliant
117+
*/
118+
@Deprecated
58119
String STRICT_FILE_INTERACTABILITY = "strictFileInteractability";
59-
String TIMEOUTS = "timeouts";
60120

121+
/**
122+
* @deprecated Non W3C compliant
123+
*/
124+
@Deprecated
61125
String LOGGING_PREFS = "loggingPrefs";
62126

127+
/**
128+
* @deprecated Non W3C compliant
129+
*/
130+
@Deprecated
63131
String ENABLE_PROFILING_CAPABILITY = "webdriver.logging.profiler.enabled";
64132

133+
134+
String BROWSER_NAME = "browserName";
135+
String PLATFORM_NAME = "platformName";
136+
String BROWSER_VERSION = "browserVersion";
137+
String ACCEPT_INSECURE_CERTS = "acceptInsecureCerts";
65138
String PAGE_LOAD_STRATEGY = "pageLoadStrategy";
139+
String PROXY = "proxy";
140+
String SET_WINDOW_RECT = "setWindowRect";
141+
String TIMEOUTS = "timeouts";
142+
String UNHANDLED_PROMPT_BEHAVIOUR = "unhandledPromptBehavior";
143+
66144

145+
/**
146+
* @deprecated Non W3C compliant
147+
*/
148+
@Deprecated
67149
interface ForSeleniumServer {
150+
151+
/**
152+
* @deprecated Non W3C compliant
153+
*/
154+
@Deprecated
68155
String AVOIDING_PROXY = "avoidProxy";
156+
/**
157+
* @deprecated Non W3C compliant
158+
*/
159+
@Deprecated
69160
String ONLY_PROXYING_SELENIUM_TRAFFIC = "onlyProxySeleniumTraffic";
161+
/**
162+
* @deprecated Non W3C compliant
163+
*/
164+
@Deprecated
70165
String PROXYING_EVERYTHING = "proxyEverything";
166+
/**
167+
* @deprecated Non W3C compliant
168+
*/
169+
@Deprecated
71170
String PROXY_PAC = "proxy_pac";
171+
/**
172+
* @deprecated Non W3C compliant
173+
*/
174+
@Deprecated
72175
String ENSURING_CLEAN_SESSION = "ensureCleanSession";
73176
}
74177
}

java/src/org/openqa/selenium/remote/DesiredCapabilities.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@
1717

1818
package org.openqa.selenium.remote;
1919

20-
import static org.openqa.selenium.remote.CapabilityType.ACCEPT_INSECURE_CERTS;
21-
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
22-
import static org.openqa.selenium.remote.CapabilityType.PLATFORM;
23-
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_JAVASCRIPT;
24-
import static org.openqa.selenium.remote.CapabilityType.VERSION;
25-
2620
import org.openqa.selenium.Capabilities;
2721
import org.openqa.selenium.MutableCapabilities;
2822
import org.openqa.selenium.Platform;
2923

3024
import java.util.Map;
3125

26+
import static org.openqa.selenium.remote.CapabilityType.ACCEPT_INSECURE_CERTS;
27+
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
28+
import static org.openqa.selenium.remote.CapabilityType.PLATFORM;
29+
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_JAVASCRIPT;
30+
import static org.openqa.selenium.remote.CapabilityType.VERSION;
31+
3232
public class DesiredCapabilities extends MutableCapabilities {
3333

3434
public DesiredCapabilities(String browser, String version, Platform platform) {
@@ -71,6 +71,10 @@ public void setPlatform(Platform platform) {
7171
setCapability(PLATFORM, platform);
7272
}
7373

74+
/**
75+
* @deprecated This setting has no effect in W3C sessions, and JWP support is going away soon.
76+
*/
77+
@Deprecated
7478
public void setJavascriptEnabled(boolean javascriptEnabled) {
7579
setCapability(SUPPORTS_JAVASCRIPT, javascriptEnabled);
7680
}

java/src/org/openqa/selenium/remote/RemoteRotatable.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@
1818
package org.openqa.selenium.remote;
1919

2020
import com.google.common.collect.ImmutableMap;
21+
2122
import org.openqa.selenium.DeviceRotation;
2223
import org.openqa.selenium.Rotatable;
2324
import org.openqa.selenium.ScreenOrientation;
2425
import org.openqa.selenium.internal.Require;
2526

2627
import java.util.Map;
2728

29+
/**
30+
* @deprecated As this is only available only for mobile which is handled by the Appium project
31+
*/
32+
@Deprecated
2833
class RemoteRotatable implements Rotatable {
2934

3035
private final ExecuteMethod executeMethod;

java/src/org/openqa/selenium/remote/html5/AddApplicationCache.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_APPLICATION_CACHE;
2828

29+
/**
30+
* @deprecated Uses a non W3C compliant capability and is not available in W3C WebDriver sessions
31+
*/
32+
@Deprecated
2933
public class AddApplicationCache implements AugmenterProvider<ApplicationCache> {
3034

3135
@Override

java/src/org/openqa/selenium/remote/html5/AddLocationContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_LOCATION_CONTEXT;
2828

29+
/**
30+
* @deprecated Uses a non W3C compliant capability and is not available in W3C WebDriver sessions
31+
*/
32+
@Deprecated
2933
public class AddLocationContext implements AugmenterProvider<LocationContext> {
3034

3135
@Override

java/src/org/openqa/selenium/remote/mobile/AddNetworkConnection.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
import static org.openqa.selenium.remote.CapabilityType.SUPPORTS_NETWORK_CONNECTION;
2828

29+
/**
30+
* @deprecated Uses a non W3C compliant capability and is not available in W3C WebDriver sessions
31+
*/
32+
@Deprecated
2933
public class AddNetworkConnection implements AugmenterProvider<NetworkConnection> {
3034

3135
@Override

0 commit comments

Comments
 (0)