Skip to content

Instantly share code, notes, and snippets.

View greboide's full-sized avatar

Glauber Alex Dias Prado greboide

View GitHub Profile
@gabehollombe
gabehollombe / Better version
Created May 20, 2010 06:26
Capybara: a better way to check if text is visible
### IMPORTANT NOTE: See the comment thread below for a more concise way to determine this now, using has_css...
#A better 'I should not see' for Capybara that lets jQuery determine visibility of the text you're looking for.
Then /^"([^\"]*)" should not be visible$/ do |text|
finder_script = %{
function is_text_visible_on_page(text) {
var match = false;
$('*:visible')