Skip to content

Commit e7b442e

Browse files
committed
js: remove a bunch of deprecated functions
1 parent 9d7c2d6 commit e7b442e

File tree

8 files changed

+11
-106
lines changed

8 files changed

+11
-106
lines changed

Diff for: javascript/node/selenium-webdriver/CHANGES.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
## v2.46.0-dev
22

3+
* Removed deprecated functions:
4+
* Capabilities#toJSON()
5+
* UnhandledAlertError#getAlert()
6+
* chrome.createDriver()
7+
* phantomjs.createDriver()
8+
* promise.ControlFlow#annotateError()
9+
* promise.ControlFlow#await()
10+
* promise.ControlFlow#clearHistory()
11+
* promise.ControlFlow#getHistory()
312
* Removed deprecated enum values: `ErrorCode.NO_MODAL_DIALOG_OPEN` and
413
`ErrorCode.MODAL_DIALOG_OPENED`. Use `ErrorCode.NO_SUCH_ALERT` and
514
`ErrorCode.UNEXPECTED_ALERT_OPEN`, respectively.

Diff for: javascript/node/selenium-webdriver/chrome.js

-16
Original file line numberDiff line numberDiff line change
@@ -753,21 +753,6 @@ Options.prototype.serialize = function() {
753753
};
754754

755755

756-
/**
757-
* Creates a new ChromeDriver session.
758-
* @param {(webdriver.Capabilities|Options)=} opt_options The session options.
759-
* @param {remote.DriverService=} opt_service The session to use; will use
760-
* the {@linkplain #getDefaultService default service} by default.
761-
* @param {webdriver.promise.ControlFlow=} opt_flow The control flow to use, or
762-
* {@code null} to use the currently active flow.
763-
* @return {!webdriver.WebDriver} A new WebDriver instance.
764-
* @deprecated Use {@link Driver new Driver()}.
765-
*/
766-
function createDriver(opt_options, opt_service, opt_flow) {
767-
return new Driver(opt_options, opt_service, opt_flow);
768-
}
769-
770-
771756
/**
772757
* Creates a new WebDriver client for Chrome.
773758
*
@@ -812,6 +797,5 @@ Driver.prototype.setFileDetector = function() {
812797
exports.Driver = Driver;
813798
exports.Options = Options;
814799
exports.ServiceBuilder = ServiceBuilder;
815-
exports.createDriver = createDriver;
816800
exports.getDefaultService = getDefaultService;
817801
exports.setDefaultService = setDefaultService;

Diff for: javascript/node/selenium-webdriver/phantomjs.js

-14
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,6 @@ var WEBDRIVER_TO_PHANTOMJS_LEVEL = (function() {
108108
})();
109109

110110

111-
/**
112-
* Creates a new PhantomJS WebDriver client.
113-
* @param {webdriver.Capabilities=} opt_capabilities The desired capabilities.
114-
* @param {webdriver.promise.ControlFlow=} opt_flow The control flow to use, or
115-
* {@code null} to use the currently active flow.
116-
* @return {!webdriver.WebDriver} A new WebDriver instance.
117-
* @deprecated Use {@link Driver}.
118-
*/
119-
function createDriver(opt_capabilities, opt_flow) {
120-
return new Driver(opt_capabilities, opt_flow);
121-
}
122-
123-
124111
/**
125112
* Creates a command executor with support for PhantomJS' custom commands.
126113
* @param {!webdriver.promise.Promise<string>} url The server's URL.
@@ -274,4 +261,3 @@ Driver.prototype.executePhantomJS = function(script, args) {
274261
// PUBLIC API
275262

276263
exports.Driver = Driver;
277-
exports.createDriver = createDriver;

Diff for: javascript/webdriver/capabilities.js

-10
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,6 @@ webdriver.Capabilities.htmlunitwithjs = function() {
284284
};
285285

286286

287-
/**
288-
* @return {!Object} The JSON representation of this instance.
289-
* @deprecated Use {@link #serialize} since a component capability may be a
290-
* promised value.
291-
*/
292-
webdriver.Capabilities.prototype.toJSON = function() {
293-
return this.caps_;
294-
};
295-
296-
297287
/**
298288
* @return {!Object.<string, ?>} The JSON representation of this instance. Note,
299289
* the returned object may contain nested promises that are promised values.

Diff for: javascript/webdriver/promise.js

-49
Original file line numberDiff line numberDiff line change
@@ -1353,40 +1353,6 @@ promise.ControlFlow.prototype.reset = function() {
13531353
};
13541354

13551355

1356-
/**
1357-
* Returns a summary of the recent task activity for this instance. This
1358-
* includes the most recently completed task, as well as any parent tasks. In
1359-
* the returned summary, the task at index N is considered a sub-task of the
1360-
* task at index N+1.
1361-
* @return {!Array<string>} A summary of this instance's recent task
1362-
* activity.
1363-
* @deprecated Now a no-op; will be removed in 2.46.0.
1364-
*/
1365-
promise.ControlFlow.prototype.getHistory = function() {
1366-
return [];
1367-
};
1368-
1369-
1370-
/**
1371-
* Clears this instance's task history.
1372-
* @deprecated Now a no-op; will be removed in 2.46.0.
1373-
*/
1374-
promise.ControlFlow.prototype.clearHistory = function() {};
1375-
1376-
1377-
/**
1378-
* Appends a summary of this instance's recent task history to the given
1379-
* error's stack trace. This function will also ensure the error's stack trace
1380-
* is in canonical form.
1381-
* @param {!(Error|goog.testing.JsUnitException)} e The error to annotate.
1382-
* @return {!(Error|goog.testing.JsUnitException)} The annotated error.
1383-
* @deprecated Now a no-op; will be removed in 2.46.0.
1384-
*/
1385-
promise.ControlFlow.prototype.annotateError = function(e) {
1386-
return e;
1387-
};
1388-
1389-
13901356
/**
13911357
* Generates an annotated string describing the internal state of this control
13921358
* flow, including the currently executing as well as pending tasks. If
@@ -1638,21 +1604,6 @@ promise.ControlFlow.prototype.wait = function(
16381604
};
16391605

16401606

1641-
/**
1642-
* Schedules a task that will wait for another promise to resolve. The resolved
1643-
* promise's value will be returned as the task result.
1644-
* @param {!promise.Promise} promise The promise to wait on.
1645-
* @return {!promise.Promise} A promise that will resolve when the
1646-
* task has completed.
1647-
* @deprecated Use {@link #wait() wait(promise)} instead.
1648-
*/
1649-
promise.ControlFlow.prototype.await = function(promise) {
1650-
return this.execute(function() {
1651-
return promise;
1652-
});
1653-
};
1654-
1655-
16561607
/**
16571608
* Schedules the interval for this instance's event loop, if necessary.
16581609
* @private

Diff for: javascript/webdriver/test/webdriver_test.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -2079,9 +2079,7 @@ function testInterceptsAndTransformsUnhandledAlertErrors() {
20792079
var driver = testHelper.createDriver();
20802080
return driver.findElement(By.id('foo')).then(fail, function(e) {
20812081
assertTrue(e instanceof webdriver.UnhandledAlertError);
2082-
return e.getAlert().getText();
2083-
}).then(function(text) {
2084-
assertEquals('hello', text);
2082+
assertEquals('hello', e.getAlertText());
20852083
});
20862084
}
20872085

@@ -2095,9 +2093,7 @@ testUnhandledAlertErrors_usesEmptyStringIfAlertTextOmittedFromResponse() {
20952093
var driver = testHelper.createDriver();
20962094
return driver.findElement(By.id('foo')).then(fail, function(e) {
20972095
assertTrue(e instanceof webdriver.UnhandledAlertError);
2098-
return e.getAlert().getText();
2099-
}).then(function(text) {
2100-
assertEquals('', text);
2096+
assertEquals('', e.getAlertText());
21012097
});
21022098
}
21032099

Diff for: javascript/webdriver/testing/testcase.js

-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ webdriver.testing.TestCase.prototype.logError = function(name, opt_e) {
150150
*/
151151
webdriver.testing.TestCase.prototype.runSingleTest_ = function(test, onError) {
152152
var flow = webdriver.promise.controlFlow();
153-
flow.clearHistory();
154153

155154
return execute(test.name + '.setUp()', this.setUp)().
156155
then(execute(test.name + '()', test.ref)).

Diff for: javascript/webdriver/webdriver.js

-10
Original file line numberDiff line numberDiff line change
@@ -2449,16 +2449,6 @@ webdriver.UnhandledAlertError.prototype.getAlertText = function() {
24492449
};
24502450

24512451

2452-
/**
2453-
* @return {!webdriver.Alert} The open alert.
2454-
* @deprecated Use {@link #getAlertText}. This method will be removed in
2455-
* 2.45.0.
2456-
*/
2457-
webdriver.UnhandledAlertError.prototype.getAlert = function() {
2458-
return this.alert_;
2459-
};
2460-
2461-
24622452

24632453
/**
24642454
* Used with {@link webdriver.WebElement#sendKeys WebElement#sendKeys} on file

0 commit comments

Comments
 (0)