webdriver
Advanced tools
Comparing version 9.5.3 to 9.5.4
@@ -1,5 +0,4 @@ | ||
import { EventEmitter } from 'node:events'; | ||
import type { Options } from '@wdio/types'; | ||
import type { WebDriverResponse, RequestLibResponse, RequestOptions } from './types.js'; | ||
export declare abstract class WebDriverRequest extends EventEmitter { | ||
import type { WebDriverResponse, RequestLibResponse, RequestOptions, RequestEventHandler } from './types.js'; | ||
export declare abstract class WebDriverRequest { | ||
protected abstract fetch(url: URL, opts: RequestInit): Promise<Response>; | ||
@@ -11,3 +10,4 @@ body?: Record<string, unknown>; | ||
requiresSessionId: boolean; | ||
constructor(method: string, endpoint: string, body?: Record<string, unknown>, isHubCommand?: boolean); | ||
eventHandler: RequestEventHandler; | ||
constructor(method: string, endpoint: string, body?: Record<string, unknown>, isHubCommand?: boolean, eventHandler?: RequestEventHandler); | ||
makeRequest(options: RequestOptions, sessionId?: string): Promise<WebDriverResponse<unknown>>; | ||
@@ -14,0 +14,0 @@ createOptions(options: RequestOptions, sessionId?: string, isBrowser?: boolean): Promise<{ |
@@ -19,2 +19,24 @@ import type { Options } from '@wdio/types'; | ||
export type RequestOptions = Omit<Options.WebDriver, 'capabilities'>; | ||
export interface RequestEventHandler { | ||
onRequest?: (ev: RequestStartEvent) => void; | ||
onResponse?: (ev: RequestEndEvent) => void; | ||
onRetry?: (ev: RequestRetryEvent) => void; | ||
onPerformance?: (ev: RequestPerformanceEvent) => void; | ||
} | ||
export type RequestStartEvent = RequestInit; | ||
export type RequestEndEvent = { | ||
result?: unknown; | ||
error?: Error; | ||
}; | ||
export type RequestRetryEvent = { | ||
error: Error; | ||
retryCount: number; | ||
}; | ||
export type RequestPerformanceEvent = { | ||
request: RequestInit; | ||
durationMillisecond: number; | ||
success: boolean; | ||
error?: Error; | ||
retryCount: number; | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -8,2 +8,3 @@ import type { EventEmitter } from 'node:events'; | ||
import type { CommandResponse } from './bidi/localTypes.js'; | ||
import type { RequestStartEvent, RequestEndEvent, RequestPerformanceEvent, RequestRetryEvent } from './request/types.js'; | ||
export interface JSONWPCommandError extends Error { | ||
@@ -53,9 +54,6 @@ code?: string; | ||
bidiResult: CommandResponse; | ||
'request.performance': { | ||
durationMillisecond: number; | ||
error: string; | ||
request: unknown; | ||
retryCount: number; | ||
success: boolean; | ||
}; | ||
'request.performance': RequestPerformanceEvent; | ||
'request.retry': RequestRetryEvent; | ||
'request.start': RequestStartEvent; | ||
'request.end': RequestEndEvent; | ||
}; | ||
@@ -62,0 +60,0 @@ export type BidiEventMap = { |
{ | ||
"name": "webdriver", | ||
"version": "9.5.3", | ||
"version": "9.5.4", | ||
"description": "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol", | ||
@@ -50,3 +50,3 @@ "author": "Christian Bromann <mail@bromann.dev>", | ||
}, | ||
"gitHead": "f637de6d4711fe0e3f6d84925286481afcacc324" | ||
"gitHead": "b4e5733841d26e9b3e29cac5630f9bb67e33e00e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
301359
5910
46