From 22c7ecfd4a9e90c8e8096e07ae6326d1c79821be Mon Sep 17 00:00:00 2001 From: Sudharsan Selvaraj Date: Thu, 23 May 2024 17:54:03 +0530 Subject: [PATCH] Fix session creation when wda is not uploaded (#1128) * Fix session creation when wda is not uploaded * Update submodule * bump up version --- package-lock.json | 4 ++-- package.json | 2 +- src/CapabilityManager.ts | 12 +++++++----- src/modules | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 360f8f921..03bcc549c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "appium-device-farm", - "version": "8.4.7-rc.32", + "version": "8.4.7-rc.33", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "appium-device-farm", - "version": "8.4.7-rc.32", + "version": "8.4.7-rc.33", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 81ec43de4..c8d73d819 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "appium-device-farm", - "version": "8.4.7-rc.32", + "version": "8.4.7-rc.33", "description": "An appium 2.0 plugin that manages and create driver session on available devices", "main": "./lib/src/main.js", "scripts": { diff --git a/src/CapabilityManager.ts b/src/CapabilityManager.ts index 2b118b60d..1c612d7b5 100644 --- a/src/CapabilityManager.ts +++ b/src/CapabilityManager.ts @@ -86,12 +86,14 @@ export async function iOSCapabilities( caps.firstMatch[0]['appium:wdaLocalPort'] = freeDevice.wdaLocalPort; caps.firstMatch[0]['appium:mjpegServerPort'] = freeDevice.mjpegServerPort; if (freeDevice.realDevice && !caps.firstMatch[0]['df:skipReport']) { - const { appBundleId } = (await prisma.appInformation.findFirst({ + const wdaInfo = await prisma.appInformation.findFirst({ where: { fileName: 'wda-resign.ipa' }, - })) as any; - caps.firstMatch[0]['appium:usePreinstalledWDA'] = true; - caps.firstMatch[0]['appium:updatedWDABundleId'] = appBundleId; - caps.firstMatch[0]['appium:updatedWDABundleIdSuffix'] = ''; + }); + if (wdaInfo) { + caps.firstMatch[0]['appium:usePreinstalledWDA'] = true; + caps.firstMatch[0]['appium:updatedWDABundleId'] = wdaInfo.appBundleId; + caps.firstMatch[0]['appium:updatedWDABundleIdSuffix'] = ''; + } } const deleteMatch = [ 'appium:derivedDataPath', diff --git a/src/modules b/src/modules index 4bbd9b434..6abb2907f 160000 --- a/src/modules +++ b/src/modules @@ -1 +1 @@ -Subproject commit 4bbd9b434934752db54a94ae621ed5d783942763 +Subproject commit 6abb2907fcbbb8bbc01defafa46fe350f618a041