Capybara/Poltergeist/PhantomJS blacklisting

Poltergeist supports URL blacklisting which allows you to prevent scripts from running on designated domains. If you are experiencing slower run times, consider creating a URL blacklist of domains that are not essential to your testing environment, such as ad networks or analytics.

page.driver.browser.url_blacklist = ['']

Make sure you set it before each running test, because this setting’s cleaned up when capybara does reset.

for example like so:

config.before(:each, js: true) do
    page.driver.browser.url_blacklist = [""]

via teampoltergeist/poltergeist: A PhantomJS driver for Capybara.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s