(options)
| 45 | } |
| 46 | |
| 47 | function getArgs(options) { |
| 48 | let args = ['--browser', options.getBrowserName(), '--language-binding', 'javascript', '--output', 'json'] |
| 49 | |
| 50 | if (options.getBrowserVersion() && options.getBrowserVersion() !== '') { |
| 51 | args.push('--browser-version', options.getBrowserVersion()) |
| 52 | } |
| 53 | |
| 54 | const vendorOptions = |
| 55 | options.get('goog:chromeOptions') || options.get('ms:edgeOptions') || options.get('moz:firefoxOptions') |
| 56 | if (vendorOptions && vendorOptions.binary && vendorOptions.binary !== '') { |
| 57 | args.push('--browser-path', path.resolve(vendorOptions.binary)) |
| 58 | } |
| 59 | |
| 60 | const proxyOptions = options.getProxy() |
| 61 | |
| 62 | // Check if proxyOptions exists and has properties |
| 63 | if (proxyOptions && Object.keys(proxyOptions).length > 0) { |
| 64 | const httpProxy = proxyOptions['httpProxy'] |
| 65 | const sslProxy = proxyOptions['sslProxy'] |
| 66 | |
| 67 | if (httpProxy !== undefined) { |
| 68 | args.push('--proxy', httpProxy) |
| 69 | } else if (sslProxy !== undefined) { |
| 70 | args.push('--proxy', sslProxy) |
| 71 | } |
| 72 | } |
| 73 | return args |
| 74 | } |
| 75 | |
| 76 | // PUBLIC API |
| 77 | module.exports = { getBinaryPaths } |
no test coverage detected