@@ -404,18 +404,17 @@ async function encodeBase64OrUpload(localPath, remotePath = null, uploadOptions
404404 * Stops and removes all web socket handlers that are listening
405405 * in scope of the current session.
406406 *
407- * @param {Object } server - The instance of NodeJs HTTP server,
408- * which hosts Appium
409- * @param {string|null } sessionId - The id of the current session
407+ * @this {XCUITestDriver}
408+ * @returns {Promise<void> }
410409 */
411- async function removeAllSessionWebSocketHandlers ( server , sessionId ) {
412- if ( ! server || ! _ . isFunction ( server . getWebSocketHandlers ) ) {
410+ export async function removeAllSessionWebSocketHandlers ( ) {
411+ if ( ! this . sessionId || ! _ . isFunction ( this . server ? .getWebSocketHandlers ) ) {
413412 return ;
414413 }
415414
416- const activeHandlers = await server . getWebSocketHandlers ( sessionId ) ;
415+ const activeHandlers = await this . server . getWebSocketHandlers ( this . sessionId ) ;
417416 for ( const pathname of _ . keys ( activeHandlers ) ) {
418- await server . removeWebSocketHandler ( pathname ) ;
417+ await this . server . removeWebSocketHandler ( pathname ) ;
419418 }
420419}
421420
@@ -538,7 +537,6 @@ export {
538537 printUser ,
539538 getPIDsListeningOnPort ,
540539 encodeBase64OrUpload ,
541- removeAllSessionWebSocketHandlers ,
542540 isLocalHost ,
543541 normalizePlatformVersion ,
544542 clearLogs ,
@@ -548,4 +546,5 @@ export {
548546/**
549547 * @typedef {import('appium-xcode').XcodeVersion } XcodeVersion
550548 * @typedef {import('appium-ios-simulator').Simulator } Simulator
549+ * @typedef {import('./driver').XCUITestDriver } XCUITestDriver
551550 */
0 commit comments