Customize Poltergeist driver configuration
masterYou can customize how Capybara sets up the Poltergeist driver by registering it with a custom options hash. This is typically done in your test setup block.
Supported options include:
:phantomjs(String): Custom path to thephantomjsexecutable.:debug(Boolean): If true, logs debug output toSTDERR.:logger(Object): An object responding toputsfor debug output.:phantomjs_logger(IO): Where PhantomJSSTDOUT(includingconsole.log) is written. Defaults toSTDOUT.:timeout(Numeric): Seconds to wait for a response from PhantomJS. Defaults to30.:inspector(Boolean, String): Enables remote debugging.:js_errors(Boolean): Iffalse, JavaScript errors are not re-raised in Ruby.:window_size(Array): Browser window dimensions, e.g.,[1024, 768]. Defaults to[1024, 768].:screen_size(Array): Dimensions used whenWindow#maximizeis called. Defaults to[1366, 768].:phantomjs_options(Array): Additional command line options for PhantomJS, e.g.,['--load-images=no'].:extensions(Array): Array of JS files to preload into the browser.:port(Fixnum): Communication port. Defaults to a random open port.:host(String): PhantomJS host IP/name. Defaults to'127.0.0.1'.:url_blacklist(Array): Array of strings to match against requested URLs to prevent script execution.:url_whitelist(Array): Array of strings to match against requested URLs to restrict script execution.:page_settings(Hash): PhantomJS web page settings.
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, options)
end