Skip to content

Instantly share code, notes, and snippets.

@ryan-scott-dev
Created November 18, 2013 23:42
Show Gist options
  • Save ryan-scott-dev/7537452 to your computer and use it in GitHub Desktop.
Save ryan-scott-dev/7537452 to your computer and use it in GitHub Desktop.
Disable bootstrap tooltips in integration tests
def disable_tooltips
page.execute_script(
" \
var css = '.tooltip { display: none !important; }', \
head = document.getElementsByTagName('head')[0], \
style = document.createElement('style'); \
style.type = 'text/css'; \
if (style.styleSheet){ \
style.styleSheet.cssText = css; \
} else { \
style.appendChild(document.createTextNode(css)); \
} \
head.appendChild(style); \
"
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment