Waiting for an iFrame to load

5 views
Skip to first unread message

Mike Jr

unread,
Oct 10, 2011, 11:21:09 AM10/10/11
to lebowskifw
It would be really great if some sproutcore contributor would add a
property to the SC.WebView iframeDidLoad function to indicate that the
iframe was loaded. But until then the following Lebowski snippet
should work. 'sproutcore_path_to_the_sc_webview' is self
explanatory. Be sure to replace it with the path to your WebView.

it "will wait for the iframe to load " do
App.wait_until(60) do |it|
iframe_body =
App.driver.get_eval("$ScPath.getPath('sproutcore_path_to_the_sc_webview')._view_layer.childNodes[0].contentWindow.document.getElementsByTagName('body')
[0]")
true if not iframe_body.nil?
end #do
end


There may be images,etc., that haven't finished loading but buttons
and other import things should be ready to go.

--Mike Jr.
Reply all
Reply to author
Forward
0 new messages