Skip to content

Commit b2b858f

Browse files
add check before removing mjpegServerPortCapability (#505)
1 parent 7af6179 commit b2b858f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/CapabilityManager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,15 @@ export async function iOSCapabilities(
4444
if (!isCapabilityAlreadyPresent(caps, 'appium:mjpegServerPort')) {
4545
if (freeDevice.realDevice) {
4646
caps.firstMatch[0]['appium:mjpegServerPort'] = await getPort();
47-
delete caps.alwaysMatch['appium:mjpegServerPort'];
4847
} else {
4948
/* In simulator, port forwarding won't happen for each session. So mjpegServerPort will be used only for 1st time.
5049
* So set the port for the first time and resuse the same port for subsequent sessions.
5150
*/
5251
const existingPort = freeDevice.mjpegServerPort;
5352
caps.firstMatch[0]['appium:mjpegServerPort'] =
5453
existingPort && (await isPortBusy(existingPort)) ? existingPort : await getPort();
55-
delete caps.alwaysMatch['appium:mjpegServerPort'];
5654
}
55+
deleteAlwaysMatch(caps, 'appium:mjpegServerPort');
5756
deleteAlwaysMatch(caps, 'appium:udid');
5857
deleteAlwaysMatch(caps, 'appium:deviceName');
5958
deleteAlwaysMatch(caps, 'appium:wdaLocalPort');

0 commit comments

Comments
 (0)