* Determines the path of the correct Selenium Manager binary * @returns {string}
()
| 35 | * @returns {string} |
| 36 | */ |
| 37 | function getBinary() { |
| 38 | const directory = { |
| 39 | darwin: 'macos', |
| 40 | win32: 'windows', |
| 41 | cygwin: 'windows', |
| 42 | linux: 'linux', |
| 43 | }[platform] |
| 44 | |
| 45 | const file = directory === 'windows' ? 'selenium-manager.exe' : 'selenium-manager' |
| 46 | |
| 47 | let seleniumManagerBasePath = path.join(__dirname, '..', '/bin') |
| 48 | |
| 49 | const filePath = process.env.SE_MANAGER_PATH || path.join(seleniumManagerBasePath, directory, file) |
| 50 | |
| 51 | if (!fs.existsSync(filePath)) { |
| 52 | throw new Error(`Unable to obtain Selenium Manager at ${filePath}`) |
| 53 | } |
| 54 | |
| 55 | if (!debugMessagePrinted) { |
| 56 | log_.debug(`Selenium Manager binary found at ${filePath}`) |
| 57 | debugMessagePrinted = true // Set the flag to true after printing the debug message |
| 58 | } |
| 59 | |
| 60 | return filePath |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Determines the path of the correct driver |
no test coverage detected