(capabilities)
| 376 | } |
| 377 | |
| 378 | function createServiceFromCapabilities(capabilities) { |
| 379 | if (process.platform !== 'win32') { |
| 380 | throw Error( |
| 381 | 'The IEDriver may only be used on Windows, but you appear to be on ' + |
| 382 | process.platform + |
| 383 | '. Did you mean to run against a remote ' + |
| 384 | 'WebDriver server?', |
| 385 | ) |
| 386 | } |
| 387 | |
| 388 | let exe = null // Let Selenium Manager find it |
| 389 | var args = [] |
| 390 | if (capabilities.has(Key.HOST)) { |
| 391 | args.push('--host=' + capabilities.get(Key.HOST)) |
| 392 | } |
| 393 | if (capabilities.has(Key.LOG_FILE)) { |
| 394 | args.push('--log-file=' + capabilities.get(Key.LOG_FILE)) |
| 395 | } |
| 396 | if (capabilities.has(Key.LOG_LEVEL)) { |
| 397 | args.push('--log-level=' + capabilities.get(Key.LOG_LEVEL)) |
| 398 | } |
| 399 | if (capabilities.has(Key.EXTRACT_PATH)) { |
| 400 | args.push('--extract-path=' + capabilities.get(Key.EXTRACT_PATH)) |
| 401 | } |
| 402 | if (capabilities.get(Key.SILENT)) { |
| 403 | args.push('--silent') |
| 404 | } |
| 405 | |
| 406 | var port = portprober.findFreePort() |
| 407 | return new remote.DriverService(exe, { |
| 408 | loopback: true, |
| 409 | port: port, |
| 410 | args: port.then(function (port) { |
| 411 | return args.concat('--port=' + port) |
| 412 | }), |
| 413 | stdio: 'ignore', |
| 414 | }) |
| 415 | } |
| 416 | |
| 417 | /** |
| 418 | * Creates {@link selenium-webdriver/remote.DriverService} instances that manage |
no test coverage detected