Watir app deployed to heroku Watir app deployed to heroku heroku heroku

Watir app deployed to heroku


Yes, it is possible! Just follow steps from this article: https://github.com/edelpero/watir-examples/blob/master/watir_on_heroku.md.

Shortly:

$ heroku config:set BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git$ touch .buildpacks

Then add to your newly created directory .buildpacks these lines:

https://github.com/heroku/heroku-buildpack-rubyhttps://github.com/stomita/heroku-buildpack-phantomjs

Then in terminal:

$ heroku config:set PATH="/usr/local/bin:/usr/bin:/bin:/app/vendor/phantomjs/bin"$ heroku config:set LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib:/app/vendor/phantomjs/lib

Then push these changes to Heroku, and

Watir::Browser.new :phantomjs

with usual Watir code following should work!


heroku-buildpack-multi is deprecated, nowadays you can add multiple buildpacks to heroku and use the phantomjs buildpack like this:

$ heroku buildpacks:add https://github.com/stomita/heroku-buildpack-phantomjs

Should work!


You can now use chrome headlessly as well, you can try it here in a sample I developed:

https://github.com/jormon/minimal-chrome-on-heroku-xvfb