File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -560,6 +560,25 @@ module Ferrum
560560 ) . not_to be_nil
561561 end
562562 end
563+
564+ it "waits for selector within frame" do
565+ browser . execute <<-JS
566+ setTimeout(function(){
567+ document.body.innerHTML += "<iframe src='about:blank' name='frame'>";
568+ var iframeDocument = document.querySelector("iframe[name='frame']").contentWindow.document;
569+ var content = "<html><body><div id='wait_for_selector_within_frame'></div></body></html>";
570+ iframeDocument.open("text/html", "replace");
571+ iframeDocument.write(content);
572+ iframeDocument.close();
573+ }, 900);
574+ JS
575+ frame = browser . wait_for_selector ( xpath : "//iframe[@name='frame']" ) . at_xpath ( "//iframe[@name='frame']" ) . frame
576+ expect (
577+ frame
578+ . wait_for_selector ( xpath : "//div[@id='wait_for_selector_within_frame']" )
579+ . at_css ( "div#wait_for_selector_within_frame" )
580+ ) . not_to be_nil
581+ end
563582 end
564583
565584 context "current_url" do
You can’t perform that action at this time.
0 commit comments