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 chrome driver path problem in Windows #416

Merged
merged 3 commits into from Apr 25, 2017

Conversation

Projects
None yet
4 participants
@xjchengo
Contributor

xjchengo commented Apr 18, 2017

After install from souce in Windows, npm run demo throws:

21:13:29 ERR PuppetWebBrowserDriver initChromeDriver() Wechaty require `chromedriver` to be installed.(try to run: "npm
install chromedriver" to fix this issue)
21:13:29 ERR PuppetWebBrowser init() exception: The ChromeDriver could not be found on the current PATH. Please download
 the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be
found on your PATH.

I solved the problem in following steps:

  1. Check if chromedriver installed correctly: these is no error when npm install and PROJECT_ROOT\node_modules\chromedriver\lib\chromedriver\chromedriver.exe exists.
  2. Check if PATH wrong: npm run demo succeeded if adding PROJECT_ROOT\node_modules\chromedriver\lib\chromedriver dir to PATH env and failed if removing PROJECT_ROOT\node_modules\chromedriver\lib\chromedriver dir from PATH env.

So i am sure the problem is related to PATH im my circumstance. After some search, I found that https://www.npmjs.com/package/chromedriver#running-with-selenium-webdriver.
When require('chromedriver'), it will do https://github.com/giggio/node-chromedriver/blob/master/lib/chromedriver.js#L2. So PATH problem solved.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Apr 18, 2017

Coverage Status

Coverage increased (+0.01%) to 54.795% when pulling 4c3dd60 on xjchengo:fix-chromedriver into 1c8fb36 on Chatie:master.

coveralls commented Apr 18, 2017

Coverage Status

Coverage increased (+0.01%) to 54.795% when pulling 4c3dd60 on xjchengo:fix-chromedriver into 1c8fb36 on Chatie:master.

@zixia

Please add comments/document to descript this magic line.

Thanks!

Show outdated Hide outdated src/puppet-web/browser-driver.ts Outdated
@xjchengo

This comment has been minimized.

Show comment
Hide comment
@xjchengo

xjchengo Apr 19, 2017

Contributor

Comments have been added. But the test failed. I will try to figure it out later.

Contributor

xjchengo commented Apr 19, 2017

Comments have been added. But the test failed. I will try to figure it out later.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Apr 19, 2017

Coverage Status

Coverage decreased (-0.08%) to 54.701% when pulling 8072783 on xjchengo:fix-chromedriver into 1c8fb36 on Chatie:master.

coveralls commented Apr 19, 2017

Coverage Status

Coverage decreased (-0.08%) to 54.701% when pulling 8072783 on xjchengo:fix-chromedriver into 1c8fb36 on Chatie:master.

@zixia

zixia approved these changes Apr 19, 2017

Thanks!

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia Apr 19, 2017

Member

Please let me know when you are ready.

Member

zixia commented Apr 19, 2017

Please let me know when you are ready.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Apr 19, 2017

Coverage Status

Coverage decreased (-0.03%) to 54.752% when pulling 250df5d on xjchengo:fix-chromedriver into 1c8fb36 on Chatie:master.

coveralls commented Apr 19, 2017

Coverage Status

Coverage decreased (-0.03%) to 54.752% when pulling 250df5d on xjchengo:fix-chromedriver into 1c8fb36 on Chatie:master.

@xjchengo

This comment has been minimized.

Show comment
Hide comment
@xjchengo

xjchengo Apr 19, 2017

Contributor

wechaty installs ChromeDriver using apk add chromedriver instead of npm install chromedriver in Docker.
So I don't require chromedriver package in Docker.
However, this time all failed tests threw:

✖ Exited because no new tests completed within the last 180000ms of inactivity

I don't know why they were timeout.

Contributor

xjchengo commented Apr 19, 2017

wechaty installs ChromeDriver using apk add chromedriver instead of npm install chromedriver in Docker.
So I don't require chromedriver package in Docker.
However, this time all failed tests threw:

✖ Exited because no new tests completed within the last 180000ms of inactivity

I don't know why they were timeout.

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia Apr 19, 2017

Member
  1. The reason that we did not use npm install chromedriver is because npm chromedriver does not support alpine Linux.

    I had submitted an issue on repository of chromedriver: giggio/node-chromedriver#70

  2. CI failed because there might have a bug in our code which will cause lost control of our code.

    We have issue #175 for monitoring this.

  3. Your PR looks good: it passed 4 CI unit tests:

    • 1 on Appveyor: node@windows
    • 2 on Travis CI: node v6@linux & v6@mac. (failed 2: node v7@linux & v7@mac)
    • 1 on CircleCI: node v7@docker. Passed after the second run.

So don't worry about the failed CI.

Before the PR can be merged, we need at least 3 approvements from @Chatie/contributor. I had already approved, so you need 2 more. After that, we can do merge. :)

Thank you very much!

Member

zixia commented Apr 19, 2017

  1. The reason that we did not use npm install chromedriver is because npm chromedriver does not support alpine Linux.

    I had submitted an issue on repository of chromedriver: giggio/node-chromedriver#70

  2. CI failed because there might have a bug in our code which will cause lost control of our code.

    We have issue #175 for monitoring this.

  3. Your PR looks good: it passed 4 CI unit tests:

    • 1 on Appveyor: node@windows
    • 2 on Travis CI: node v6@linux & v6@mac. (failed 2: node v7@linux & v7@mac)
    • 1 on CircleCI: node v7@docker. Passed after the second run.

So don't worry about the failed CI.

Before the PR can be merged, we need at least 3 approvements from @Chatie/contributor. I had already approved, so you need 2 more. After that, we can do merge. :)

Thank you very much!

@Gcaufy

Gcaufy approved these changes Apr 20, 2017

code looks good for me.

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia Apr 24, 2017

Member

@Chatie/contributor anyone who still using windows could check and approve this PR?

Member

zixia commented Apr 24, 2017

@Chatie/contributor anyone who still using windows could check and approve this PR?

@zixia zixia merged commit 95d35f1 into Chatie:master Apr 25, 2017

5 of 6 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
ci/circleci Your tests passed on CircleCI!
Details
codacy/pr Good work! A positive pull request.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
coverage/coveralls Coverage decreased (-0.03%) to 54.752%
Details
security/snyk No new vulnerabilities
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment