-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug when specifying customGeckoDriverPath #222
Conversation
const browser = await remote({ | ||
automationProtocol: 'webdriver', | ||
hostname: '0.0.0.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is no longer necessary as the default value has changed from localhost
to 0.0.0.0
. See: webdriverio/webdriverio@c6d81b5#diff-b5fe71260eef292213595160b7583dabd5475f9775eee92b92d00d0c5fb1fa7f
const browser = await remote({ | ||
automationProtocol: 'webdriver', | ||
hostname: '0.0.0.0', | ||
port, // must set port or wdio will automatically start geckodriver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent PR 👌 nice work!
Can we update the branch? |
WHAT? Destructured `customGeckoDriverPath` out of `params` in `function start()`. Additionally, updated `test.e2e.js` to test the three `webdriver` usage modes: 1/ automatically download and start, 2/ automatically start, 3/ manually start. Finally, added a self-referencing `devDependency` to `geckodriver` since `webdriverio` transitively depends on it. WHY? Before this change, running the following code: ```ts import { start } from 'geckodriver' await start({ customGeckoDriverPath: '/some/path/geckodriver' }) ``` Would fail to start the `geckodriver` because it would execute: ```shell geckodriver --custom-gecko-driver-path=/some/path/geckodriver --port=43083 --host=0.0.0.0 --websocket-port=0 ``` Which results in exit code `64` and the following output: ```log /some/path/geckodriver: error: Found argument '--custom-gecko-driver-path' which wasn't expected, or isn't valid in this context If you tried to supply `--custom-gecko-driver-path` as a value rather than a flag, use `-- --custom-gecko-driver-path` USAGE: geckodriver [OPTIONS] For more information try --help ``` By destructuring `customGeckoDriverPath`, the extraneous `--custom-gecko-driver-path` argument is no longer specified and the webdriver starts successfully. HOW? Successfully ran: ```shell npm run build && npm test ```
Done! |
Thank you! |
WHAT?
Destructured
customGeckoDriverPath
out ofparams
infunction start()
.Additionally, updated
test.e2e.js
to test the threewebdriver
usage modes: 1/ automatically download and start, 2/ automatically start, 3/ manually start.Finally, added a self-referencing
devDependency
togeckodriver
sincewebdriverio
transitively depends on it.WHY?
Before this change, running the following code:
Would fail to start the
geckodriver
because it would execute:Which results in exit code
64
and the following output:By destructuring
customGeckoDriverPath
, the extraneous--custom-gecko-driver-path
argument is no longer specified and the webdriver starts successfully.HOW?
Successfully ran: