Created
October 25, 2010 11:49
-
-
Save pschyska/644832 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
When /^(?:|I )should really see "([^"]*)"(?: within "([^"]*)")?$/ do |text, scope| | |
page.wait_until{ page.evaluate_script("!Ext.Ajax.isLoading()") } | |
found=page.driver.browser.execute_script <<-JS | |
var found=false; | |
Ext.ComponentMgr.all.each(function(cp) { | |
if(cp.el) { | |
if(cp.el.getAttribute('textContent').indexOf('#{text}')!= -1) { | |
if(cp.el.isVisible()) { | |
found=true; | |
} else { | |
console.info("Found "+cp.el+", but not visible"); | |
} | |
} | |
} | |
} | |
); | |
return found; | |
JS | |
found.should == true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment