Skip to content

Commit

Permalink
Fix : ChromeDriverPath when multiple devices connect, it was updated …
Browse files Browse the repository at this point in the history
…the path of latest file downloaded in the folder (#857)
  • Loading branch information
AnilPatidar authored Nov 1, 2023
1 parent 72d0ff3 commit fc9a1d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/device-managers/ChromeDriverManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
getOsInfo,
} from '../chromeUtils';
import { ChromedriverStorageClient } from 'appium-chromedriver';
import log from '../logger';

export default class ChromeDriverManager {
private static instance: ChromeDriverManager;
Expand Down Expand Up @@ -47,7 +48,9 @@ export default class ChromeDriverManager {
return acc;
}, {});
const versions = Object.keys(synchronizedDriversMapping);
const latestVersion = `v${versions[versions.length - 1]}`;
const fallBackVersion = `v${versions[versions.length - 1]}`;
const newVersion = Object.keys(synchronizedDriversMapping).find(k => synchronizedDriversMapping[k] === version);
const latestVersion = (newVersion !== null && newVersion !== undefined) ? `v${newVersion}` : `v${fallBackVersion}`;
return `${await getChromedriverBinaryPath(this.tempDirectory)}/chromedriver_${
this.osInfo.name
}${this.osInfo.arch}_${latestVersion}`;
Expand Down

0 comments on commit fc9a1d0

Please sign in to comment.