Created
July 11, 2014 18:14
-
-
Save Blackbaud-TitusFortner/c5503da9043b13969f59 to your computer and use it in GitHub Desktop.
Headless support in watirmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new_watir_browser | |
set_headless if config.headless | |
..... | |
end | |
def set_headless | |
begin | |
require 'headless' | |
@headless = Headless.new | |
@headless.start | |
rescue LoadError, Headless::Exception => e | |
unless RbConfig::CONFIG['host_os'].match('linux') | |
warn "Attempted to run in headless mode, but xvfb support is limited to linux" | |
else | |
warn "Attempted to run in headless mode, but #{e.message}" | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment