@@ -434,31 +434,33 @@ export function isWebview(this: XCUITestDriver): boolean {
434434 * @returns A configured RemoteDebugger instance
435435 */
436436export async function getNewRemoteDebugger ( this : XCUITestDriver ) : Promise < RemoteDebugger > {
437- const socketPath = this . isRealDevice ( )
437+ const isRealDevice = this . isRealDevice ( ) ;
438+ const socketPath = isRealDevice
438439 ? undefined
439440 : ( await ( this . device as Simulator ) . getWebInspectorSocket ( ) ?? undefined ) ;
440- return createRemoteDebugger (
441- {
442- bundleId : this . opts . bundleId ,
443- additionalBundleIds : this . opts . additionalWebviewBundleIds as string [ ] | undefined ,
444- isSafari : this . isSafari ( ) ,
445- includeSafari : this . opts . includeSafariInWebviews ,
446- pageLoadMs : this . pageLoadMs ,
447- platformVersion : this . opts . platformVersion ,
448- socketPath,
449- remoteDebugProxy : this . opts . remoteDebugProxy ,
450- garbageCollectOnExecute : util . hasValue ( this . opts . safariGarbageCollect )
451- ? ! ! this . opts . safariGarbageCollect
452- : false ,
453- udid : this . opts . udid as string ,
454- logAllCommunication : this . opts . safariLogAllCommunication ,
455- logAllCommunicationHexDump : this . opts . safariLogAllCommunicationHexDump ,
456- socketChunkSize : this . opts . safariSocketChunkSize ,
457- webInspectorMaxFrameLength : this . opts . safariWebInspectorMaxFrameLength ,
458- pageLoadStrategy : this . caps . pageLoadStrategy ,
459- } ,
460- this . isRealDevice ( ) ,
461- ) ;
441+
442+ const baseOpts = {
443+ bundleId : this . opts . bundleId ,
444+ additionalBundleIds : this . opts . additionalWebviewBundleIds as string [ ] | undefined ,
445+ isSafari : this . isSafari ( ) ,
446+ includeSafari : this . opts . includeSafariInWebviews ,
447+ pageLoadMs : this . pageLoadMs ,
448+ platformVersion : this . opts . platformVersion ,
449+ socketPath,
450+ remoteDebugProxy : this . opts . remoteDebugProxy ,
451+ garbageCollectOnExecute : util . hasValue ( this . opts . safariGarbageCollect )
452+ ? ! ! this . opts . safariGarbageCollect
453+ : false ,
454+ logAllCommunication : this . opts . safariLogAllCommunication ,
455+ logAllCommunicationHexDump : this . opts . safariLogAllCommunicationHexDump ,
456+ socketChunkSize : this . opts . safariSocketChunkSize ,
457+ webInspectorMaxFrameLength : this . opts . safariWebInspectorMaxFrameLength ,
458+ pageLoadStrategy : this . caps . pageLoadStrategy ,
459+ } ;
460+
461+ return isRealDevice
462+ ? createRemoteDebugger ( { ...baseOpts , udid : this . opts . udid as string } , true )
463+ : createRemoteDebugger ( baseOpts , false ) ;
462464}
463465
464466/**
0 commit comments