I am trying to integrate travis to my cucumber tests using watir. However, Now, I seem to be stuck in the last problem with chromedriver. I get the error
Unable to find chromedriver. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
(Selenium::WebDriver::Error::WebDriverError)
I fixed this thing in my local windows machine by adding chromedriver
in lib
folder of ruby
and adding path to system32, webem
I am not sure on how to do about this in Travis
. Can someone help me?
My .travis.yml file looks like this
sudo: required
language: ruby
cache: bundler
rvm: 2.2
before_script:
- bundle install
- gem install watir
- gem install colorize
- gem install rspec
- gem install cucumber
script: bundle exec cucumber
branches:
only:
- master
notifications:
email:
- iamsmj@gmail.com
I have added the below code to the existing .yml
addons: apt: packages: - chromium-browser - chromium-chromedriver
rvm: 2.2
before_script:
- bundle install
- gem install watir
- gem install colorize
- gem install rspec
- gem install cucumber
- wget http://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- sudo chmod u+x chromedriver
- sudo mv chromedriver /usr/bin/
- export CHROME_BIN=chromium-browser
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3
- ./travis_before_install
The error i get now is
--2017-02-13 18:04:46-- http://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip
Resolving chromedriver.storage.googleapis.com (chromedriver.storage.googleapis.com)... 64.233.191.128, 2607:f8b0:4001:c0c::80
Connecting to chromedriver.storage.googleapis.com (chromedriver.storage.googleapis.com)|64.233.191.128|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2692616 (2.6M) [application/zip]
Saving to: `chromedriver_linux64.zip'
0% [ ] 0 --.-K/s 100%[======================================>] 2,692,616 --.-K/s in 0.009s
wget: unable to resolve host address `.'
FINISHED --2017-02-13 18:04:48--
Total wall clock time: 1.5s
Downloaded: 1 files, 2.6M in 0.009s (281 MB/s)
The command "wget http://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - sudo chmod u+x chromedriver - sudo mv chromedriver /usr/bin/ - export CHROME_BIN=chromium-browser - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - sleep 3 - ./travis_before_install" failed and exited with 4 during .
Your build has been stopped.
Also, Could someone please let me know, why travis wouldnt run this?
`The command "bundle exec cucumber" exited with 2.`
UPDATE: I updated the file fixing the indentation in the `before_script` . The latest error i get is
0.08s$ unzip chromedriver_linux64.zip
Archive: chromedriver_linux64.zip
inflating: chromedriver
before_script.10
0.01s$ sudo chmod u+x chromedriver
before_script.11
0.01s$ sudo mv chromedriver /usr/bin/
before_script.12
0.00s$ export CHROME_BIN=chromium-browser
before_script.13
0.00s$ export DISPLAY=:99.0
before_script.14
0.01s$ sh -e /etc/init.d/xvfb start
Starting virtual X frame buffer: Xvfb.
before_script.15
3.01s$ sleep 3
2.55s$ bundle exec cucumber
end of file reached (EOFError)
The command "bundle exec cucumber" exited with 2.
Done. Your build exited with 1.
**Update:** I tried fixing up the identation errors in the script as. The new error i get is
0% [ ] 0 --.-K/s 100%[======================================>] 2,692,616 --.-K/s in 0.01s
2017-02-14 11:00:45 (173 MB/s) - ‘chromedriver_linux64.zip’ saved [2692616/2692616]
before_script.9
0.08s$ unzip chromedriver_linux64.zip
Archive: chromedriver_linux64.zip
inflating: chromedriver
before_script.10
0.01s$ sudo chmod u+x chromedriver
before_script.11
0.01s$ sudo mv chromedriver /usr/bin/
before_script.12
0.00s$ export CHROME_BIN=chromium-browser
before_script.13
0.00s$ export DISPLAY=:99.0
before_script.14
0.01s$ sh -e /etc/init.d/xvfb start
Starting virtual X frame buffer: Xvfb.
before_script.15
3.01s$ sleep 3
2.55s$ bundle exec cucumber
**end of file reached (EOFError)**
The command "bundle exec cucumber" exited with 2.
Done. Your build exited with 1.