selenium-webdriver 4.45.0 → 4.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +7 -0
- package/bidi/generated/browser.js +2 -2
- package/bidi/generated/browsing_context.d.ts +39 -2
- package/bidi/generated/browsing_context.js +22 -2
- package/bidi/generated/common.d.ts +1 -1
- package/bidi/generated/input.js +2 -2
- package/bidi/generated/log.js +2 -2
- package/bidi/generated/network.js +2 -2
- package/bidi/generated/script.d.ts +1 -1
- package/bidi/generated/script.js +2 -2
- package/bidi/generated/storage.js +2 -2
- package/bin/linux/selenium-manager +0 -0
- package/bin/macos/selenium-manager +0 -0
- package/bin/windows/selenium-manager.exe +0 -0
- package/lib/until.js +7 -9
- package/package.json +9 -9
package/CHANGES.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## 4.46.0
|
|
2
|
+
|
|
3
|
+
- Support CDP versions: v148, v149, v150
|
|
4
|
+
- Add binding-neutral BiDi schema with cddl2ts-gated fidelity (#17700)
|
|
5
|
+
- Update cddl to 0.21.0 to fix quoted reserved-word parsing in BiDi codegen (#17752)
|
|
6
|
+
- Add guidance for testing conventions in each language (#16734)
|
|
7
|
+
|
|
1
8
|
## 4.45.0
|
|
2
9
|
|
|
3
10
|
- Support CDP versions: v147, v148, v149
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
// specific language governing permissions and limitations
|
|
17
17
|
// under the License.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.Browser =
|
|
19
|
+
exports.Browser = void 0;
|
|
20
|
+
exports.getBrowserInstance = getBrowserInstance;
|
|
20
21
|
// --- Additional Types ---
|
|
21
22
|
/** @deprecated Use {@link Browser.create} instead — will be removed in a future major version. */
|
|
22
23
|
async function getBrowserInstance(driver) {
|
|
23
24
|
return Browser.create(driver);
|
|
24
25
|
}
|
|
25
|
-
exports.getBrowserInstance = getBrowserInstance;
|
|
26
26
|
// --- Implementation ---
|
|
27
27
|
class Browser {
|
|
28
28
|
constructor(bidi) {
|
|
@@ -2,8 +2,8 @@ import type { BrowserClientWindow, BrowserUserContext } from './browser.js';
|
|
|
2
2
|
import type { EmptyResult, JsInt, JsUint } from './common.js';
|
|
3
3
|
import type { ScriptNodeRemoteValue, ScriptSerializationOptions, ScriptSharedReference } from './script.js';
|
|
4
4
|
import type { SessionUserPromptHandlerType } from './session.js';
|
|
5
|
-
export type BrowsingContextCommand = BrowsingContextActivate | BrowsingContextCaptureScreenshot | BrowsingContextClose | BrowsingContextCreate | BrowsingContextGetTree | BrowsingContextHandleUserPrompt | BrowsingContextLocateNodes | BrowsingContextNavigate | BrowsingContextPrint | BrowsingContextReload | BrowsingContextSetBypassCsp | BrowsingContextSetViewport | BrowsingContextTraverseHistory;
|
|
6
|
-
export type BrowsingContextResult = BrowsingContextActivateResult | BrowsingContextCaptureScreenshotResult | BrowsingContextCloseResult | BrowsingContextCreateResult | BrowsingContextGetTreeResult | BrowsingContextHandleUserPromptResult | BrowsingContextLocateNodesResult | BrowsingContextNavigateResult | BrowsingContextPrintResult | BrowsingContextReloadResult | BrowsingContextSetBypassCspResult | BrowsingContextSetViewportResult | BrowsingContextTraverseHistoryResult;
|
|
5
|
+
export type BrowsingContextCommand = BrowsingContextActivate | BrowsingContextCaptureScreenshot | BrowsingContextClose | BrowsingContextCreate | BrowsingContextGetTree | BrowsingContextHandleUserPrompt | BrowsingContextLocateNodes | BrowsingContextNavigate | BrowsingContextPrint | BrowsingContextReload | BrowsingContextSetBypassCsp | BrowsingContextSetViewport | BrowsingContextStartScreencast | BrowsingContextStopScreencast | BrowsingContextTraverseHistory;
|
|
6
|
+
export type BrowsingContextResult = BrowsingContextActivateResult | BrowsingContextCaptureScreenshotResult | BrowsingContextCloseResult | BrowsingContextCreateResult | BrowsingContextGetTreeResult | BrowsingContextHandleUserPromptResult | BrowsingContextLocateNodesResult | BrowsingContextNavigateResult | BrowsingContextPrintResult | BrowsingContextReloadResult | BrowsingContextSetBypassCspResult | BrowsingContextSetViewportResult | BrowsingContextStartScreencastResult | BrowsingContextStopScreencastResult | BrowsingContextTraverseHistoryResult;
|
|
7
7
|
export type BrowsingContextEvent = BrowsingContextContextCreated | BrowsingContextContextDestroyed | BrowsingContextDomContentLoaded | BrowsingContextDownloadEnd | BrowsingContextDownloadWillBegin | BrowsingContextFragmentNavigated | BrowsingContextHistoryUpdated | BrowsingContextLoad | BrowsingContextNavigationAborted | BrowsingContextNavigationCommitted | BrowsingContextNavigationFailed | BrowsingContextNavigationStarted | BrowsingContextUserPromptClosed | BrowsingContextUserPromptOpened;
|
|
8
8
|
export type BrowsingContextBrowsingContext = string;
|
|
9
9
|
export type BrowsingContextInfoList = BrowsingContextInfo[];
|
|
@@ -46,6 +46,7 @@ export interface BrowsingContextXPathLocator {
|
|
|
46
46
|
value: string;
|
|
47
47
|
}
|
|
48
48
|
export type BrowsingContextNavigation = string;
|
|
49
|
+
export type BrowsingContextDownload = string;
|
|
49
50
|
export interface BrowsingContextBaseNavigationInfo {
|
|
50
51
|
context: BrowsingContextBrowsingContext;
|
|
51
52
|
navigation: BrowsingContextNavigation | null;
|
|
@@ -257,6 +258,37 @@ export interface BrowsingContextViewport {
|
|
|
257
258
|
height: JsUint;
|
|
258
259
|
}
|
|
259
260
|
export type BrowsingContextSetViewportResult = EmptyResult;
|
|
261
|
+
export interface BrowsingContextStartScreencast {
|
|
262
|
+
method: "browsingContext.startScreencast";
|
|
263
|
+
params: BrowsingContextStartScreencastParameters;
|
|
264
|
+
}
|
|
265
|
+
export interface BrowsingContextStartScreencastParameters {
|
|
266
|
+
context: BrowsingContextBrowsingContext;
|
|
267
|
+
mimeType?: string;
|
|
268
|
+
video?: BrowsingContextMediaTrackConstraints;
|
|
269
|
+
audio?: boolean;
|
|
270
|
+
}
|
|
271
|
+
export interface BrowsingContextMediaTrackConstraints {
|
|
272
|
+
width?: JsUint;
|
|
273
|
+
height?: JsUint;
|
|
274
|
+
frameRate?: JsUint;
|
|
275
|
+
}
|
|
276
|
+
export interface BrowsingContextStartScreencastResult {
|
|
277
|
+
screencast: BrowsingContextScreencast;
|
|
278
|
+
path: string;
|
|
279
|
+
}
|
|
280
|
+
export type BrowsingContextScreencast = string;
|
|
281
|
+
export interface BrowsingContextStopScreencast {
|
|
282
|
+
method: "browsingContext.stopScreencast";
|
|
283
|
+
params: BrowsingContextStopScreencastParameters;
|
|
284
|
+
}
|
|
285
|
+
export interface BrowsingContextStopScreencastParameters {
|
|
286
|
+
screencast: BrowsingContextScreencast;
|
|
287
|
+
}
|
|
288
|
+
export interface BrowsingContextStopScreencastResult {
|
|
289
|
+
path: string;
|
|
290
|
+
error?: string;
|
|
291
|
+
}
|
|
260
292
|
export interface BrowsingContextTraverseHistory {
|
|
261
293
|
method: "browsingContext.traverseHistory";
|
|
262
294
|
params: BrowsingContextTraverseHistoryParameters;
|
|
@@ -305,6 +337,7 @@ export interface BrowsingContextDownloadWillBegin {
|
|
|
305
337
|
params: BrowsingContextDownloadWillBeginParams;
|
|
306
338
|
}
|
|
307
339
|
export type BrowsingContextDownloadWillBeginParams = BrowsingContextBaseNavigationInfo & {
|
|
340
|
+
download: BrowsingContextDownload;
|
|
308
341
|
suggestedFilename: string;
|
|
309
342
|
};
|
|
310
343
|
export interface BrowsingContextDownloadEnd {
|
|
@@ -314,9 +347,11 @@ export interface BrowsingContextDownloadEnd {
|
|
|
314
347
|
export type BrowsingContextDownloadEndParams = (BrowsingContextDownloadCanceledParams | BrowsingContextDownloadCompleteParams);
|
|
315
348
|
export type BrowsingContextDownloadCanceledParams = BrowsingContextBaseNavigationInfo & {
|
|
316
349
|
status: "canceled";
|
|
350
|
+
download: BrowsingContextDownload;
|
|
317
351
|
};
|
|
318
352
|
export type BrowsingContextDownloadCompleteParams = BrowsingContextBaseNavigationInfo & {
|
|
319
353
|
status: "complete";
|
|
354
|
+
download: BrowsingContextDownload;
|
|
320
355
|
filepath: string | null;
|
|
321
356
|
};
|
|
322
357
|
export interface BrowsingContextNavigationAborted {
|
|
@@ -372,6 +407,8 @@ export declare class BrowsingContext {
|
|
|
372
407
|
reload(params: BrowsingContextReloadParameters): Promise<BrowsingContextReloadResult>;
|
|
373
408
|
setBypassCSP(params: BrowsingContextSetBypassCspParameters): Promise<void>;
|
|
374
409
|
setViewport(params: BrowsingContextSetViewportParameters): Promise<void>;
|
|
410
|
+
startScreencast(params: BrowsingContextStartScreencastParameters): Promise<BrowsingContextStartScreencastResult>;
|
|
411
|
+
stopScreencast(params: BrowsingContextStopScreencastParameters): Promise<BrowsingContextStopScreencastResult>;
|
|
375
412
|
traverseHistory(params: BrowsingContextTraverseHistoryParameters): Promise<void>;
|
|
376
413
|
onContextCreated(callback: (params: BrowsingContextInfo) => void): Promise<void>;
|
|
377
414
|
onContextDestroyed(callback: (params: BrowsingContextInfo) => void): Promise<void>;
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
// specific language governing permissions and limitations
|
|
17
17
|
// under the License.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.BrowsingContext =
|
|
19
|
+
exports.BrowsingContext = void 0;
|
|
20
|
+
exports.getBrowsingContextInstance = getBrowsingContextInstance;
|
|
20
21
|
// --- Additional Types ---
|
|
21
22
|
/** @deprecated Use {@link BrowsingContext.create} instead — will be removed in a future major version. */
|
|
22
23
|
async function getBrowsingContextInstance(driver) {
|
|
23
24
|
return BrowsingContext.create(driver);
|
|
24
25
|
}
|
|
25
|
-
exports.getBrowsingContextInstance = getBrowsingContextInstance;
|
|
26
26
|
// --- Implementation ---
|
|
27
27
|
class BrowsingContext {
|
|
28
28
|
constructor(bidi) {
|
|
@@ -151,6 +151,26 @@ class BrowsingContext {
|
|
|
151
151
|
throw new Error(`${response['error']}: ${response['message']}`);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
+
async startScreencast(params) {
|
|
155
|
+
const response = await this.bidi.send({
|
|
156
|
+
method: 'browsingContext.startScreencast',
|
|
157
|
+
params: params,
|
|
158
|
+
});
|
|
159
|
+
if (response['type'] === 'error') {
|
|
160
|
+
throw new Error(`${response['error']}: ${response['message']}`);
|
|
161
|
+
}
|
|
162
|
+
return response.result;
|
|
163
|
+
}
|
|
164
|
+
async stopScreencast(params) {
|
|
165
|
+
const response = await this.bidi.send({
|
|
166
|
+
method: 'browsingContext.stopScreencast',
|
|
167
|
+
params: params,
|
|
168
|
+
});
|
|
169
|
+
if (response['type'] === 'error') {
|
|
170
|
+
throw new Error(`${response['error']}: ${response['message']}`);
|
|
171
|
+
}
|
|
172
|
+
return response.result;
|
|
173
|
+
}
|
|
154
174
|
async traverseHistory(params) {
|
|
155
175
|
const response = await this.bidi.send({
|
|
156
176
|
method: 'browsingContext.traverseHistory',
|
|
@@ -35,4 +35,4 @@ export type EventData = BrowsingContextEvent | InputEvent | LogEvent | NetworkEv
|
|
|
35
35
|
export type Extensible = Record<string, unknown>;
|
|
36
36
|
export type JsInt = number;
|
|
37
37
|
export type JsUint = number;
|
|
38
|
-
export type ErrorCode = "invalid argument" | "invalid selector" | "invalid session id" | "invalid web extension" | "move target out of bounds" | "no such alert" | "no such network collector" | "no such element" | "no such frame" | "no such handle" | "no such history entry" | "no such intercept" | "no such network data" | "no such node" | "no such request" | "no such script" | "no such storage partition" | "no such user context" | "no such web extension" | "session not created" | "unable to capture screen" | "unable to close browser" | "unable to set cookie" | "unable to set file input" | "unavailable network data" | "underspecified storage partition" | "unknown command" | "unknown error" | "unsupported operation";
|
|
38
|
+
export type ErrorCode = "invalid argument" | "invalid selector" | "invalid session id" | "invalid web extension" | "move target out of bounds" | "no such alert" | "no such network collector" | "no such element" | "no such frame" | "no such handle" | "no such history entry" | "no such intercept" | "no such network data" | "no such node" | "no such request" | "no such screencast" | "no such script" | "no such storage partition" | "no such user context" | "no such web extension" | "session not created" | "unable to capture screen" | "unable to close browser" | "unable to set cookie" | "unable to set file input" | "unavailable network data" | "underspecified storage partition" | "unknown command" | "unknown error" | "unsupported operation";
|
package/bidi/generated/input.js
CHANGED
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
// specific language governing permissions and limitations
|
|
17
17
|
// under the License.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.Input =
|
|
19
|
+
exports.Input = void 0;
|
|
20
|
+
exports.getInputInstance = getInputInstance;
|
|
20
21
|
// --- Additional Types ---
|
|
21
22
|
/** @deprecated Use {@link Input.create} instead — will be removed in a future major version. */
|
|
22
23
|
async function getInputInstance(driver) {
|
|
23
24
|
return Input.create(driver);
|
|
24
25
|
}
|
|
25
|
-
exports.getInputInstance = getInputInstance;
|
|
26
26
|
// --- Implementation ---
|
|
27
27
|
class Input {
|
|
28
28
|
constructor(bidi) {
|
package/bidi/generated/log.js
CHANGED
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
// specific language governing permissions and limitations
|
|
17
17
|
// under the License.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.Log =
|
|
19
|
+
exports.Log = void 0;
|
|
20
|
+
exports.getLogInspectorInstance = getLogInspectorInstance;
|
|
20
21
|
// --- Additional Types ---
|
|
21
22
|
/** @deprecated Use {@link Log.create} instead — will be removed in a future major version. */
|
|
22
23
|
async function getLogInspectorInstance(driver) {
|
|
23
24
|
return Log.create(driver);
|
|
24
25
|
}
|
|
25
|
-
exports.getLogInspectorInstance = getLogInspectorInstance;
|
|
26
26
|
// --- Implementation ---
|
|
27
27
|
class Log {
|
|
28
28
|
constructor(bidi) {
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
// specific language governing permissions and limitations
|
|
17
17
|
// under the License.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.Network =
|
|
19
|
+
exports.Network = void 0;
|
|
20
|
+
exports.getNetworkInstance = getNetworkInstance;
|
|
20
21
|
// --- Additional Types ---
|
|
21
22
|
/** @deprecated Use {@link Network.create} instead — will be removed in a future major version. */
|
|
22
23
|
async function getNetworkInstance(driver) {
|
|
23
24
|
return Network.create(driver);
|
|
24
25
|
}
|
|
25
|
-
exports.getNetworkInstance = getNetworkInstance;
|
|
26
26
|
// --- Implementation ---
|
|
27
27
|
class Network {
|
|
28
28
|
constructor(bidi) {
|
package/bidi/generated/script.js
CHANGED
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
// specific language governing permissions and limitations
|
|
17
17
|
// under the License.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.Script =
|
|
19
|
+
exports.Script = void 0;
|
|
20
|
+
exports.getScriptManagerInstance = getScriptManagerInstance;
|
|
20
21
|
// --- Additional Types ---
|
|
21
22
|
/** @deprecated Use {@link Script.create} instead — will be removed in a future major version. */
|
|
22
23
|
async function getScriptManagerInstance(driver) {
|
|
23
24
|
return Script.create(driver);
|
|
24
25
|
}
|
|
25
|
-
exports.getScriptManagerInstance = getScriptManagerInstance;
|
|
26
26
|
// --- Implementation ---
|
|
27
27
|
class Script {
|
|
28
28
|
constructor(bidi) {
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
// specific language governing permissions and limitations
|
|
17
17
|
// under the License.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.Storage =
|
|
19
|
+
exports.Storage = void 0;
|
|
20
|
+
exports.getStorageInstance = getStorageInstance;
|
|
20
21
|
// --- Additional Types ---
|
|
21
22
|
/** @deprecated Use {@link Storage.create} instead — will be removed in a future major version. */
|
|
22
23
|
async function getStorageInstance(driver) {
|
|
23
24
|
return Storage.create(driver);
|
|
24
25
|
}
|
|
25
|
-
exports.getStorageInstance = getStorageInstance;
|
|
26
26
|
// --- Implementation ---
|
|
27
27
|
class Storage {
|
|
28
28
|
constructor(bidi) {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/until.js
CHANGED
|
@@ -113,15 +113,13 @@ function alertIsPresent() {
|
|
|
113
113
|
.switchTo()
|
|
114
114
|
.alert()
|
|
115
115
|
.catch(function (e) {
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
-
) {
|
|
116
|
+
if (!(
|
|
117
|
+
e instanceof error.NoSuchAlertError ||
|
|
118
|
+
// XXX: Workaround for GeckoDriver error `TypeError: can't convert null
|
|
119
|
+
// to object`. For more details, see
|
|
120
|
+
// https://github.com/SeleniumHQ/selenium/pull/2137
|
|
121
|
+
(e instanceof error.WebDriverError && e.message === `can't convert null to object`)
|
|
122
|
+
)) {
|
|
125
123
|
throw e
|
|
126
124
|
}
|
|
127
125
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "selenium-webdriver",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.46.0",
|
|
4
4
|
"description": "The official WebDriver JavaScript bindings from the Selenium project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -30,23 +30,23 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@eslint/js": "^10.0.1",
|
|
33
|
-
"cddl": "^0.
|
|
34
|
-
"cddl2ts": "^0.
|
|
35
|
-
"clean-jsdoc-theme": "^4.3.
|
|
36
|
-
"eslint": "^10.
|
|
33
|
+
"cddl": "^0.21.0",
|
|
34
|
+
"cddl2ts": "^0.10.0",
|
|
35
|
+
"clean-jsdoc-theme": "^4.3.3",
|
|
36
|
+
"eslint": "^10.7.0",
|
|
37
37
|
"eslint-config-prettier": "^10.1.8",
|
|
38
38
|
"eslint-plugin-mocha": "^11.3.0",
|
|
39
|
-
"eslint-plugin-n": "^18.1
|
|
39
|
+
"eslint-plugin-n": "^18.2.1",
|
|
40
40
|
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
41
41
|
"eslint-plugin-prettier": "^5.5.6",
|
|
42
42
|
"express": "^5.2.1",
|
|
43
|
-
"globals": "^17.
|
|
43
|
+
"globals": "^17.7.0",
|
|
44
44
|
"has-flag": "^5.0.1",
|
|
45
45
|
"jsdoc": "^4.0.5",
|
|
46
46
|
"mocha": "^11.7.6",
|
|
47
47
|
"mocha-junit-reporter": "^2.2.1",
|
|
48
|
-
"multer": "^2.
|
|
49
|
-
"prettier": "^3.
|
|
48
|
+
"multer": "^2.2.0",
|
|
49
|
+
"prettier": "^3.9.5",
|
|
50
50
|
"serve-index": "^1.9.2",
|
|
51
51
|
"sinon": "^22.0.0",
|
|
52
52
|
"supports-color": "^10.2.2"
|