File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ def content=(html)
113
113
document.close();
114
114
arguments[1](true);
115
115
) , @page . timeout , html )
116
+ @page . document_node_id
116
117
end
117
118
alias set_content content =
118
119
Original file line number Diff line number Diff line change @@ -325,6 +325,10 @@ def use_authorized_proxy?
325
325
use_proxy? && @proxy_user && @proxy_password
326
326
end
327
327
328
+ def document_node_id
329
+ command ( "DOM.getDocument" , depth : 0 ) . dig ( "root" , "nodeId" )
330
+ end
331
+
328
332
private
329
333
330
334
def subscribe
@@ -441,10 +445,6 @@ def combine_url!(url_or_path)
441
445
( nil_or_relative ? @browser . base_url . join ( url . to_s ) : url ) . to_s
442
446
end
443
447
444
- def document_node_id
445
- command ( "DOM.getDocument" , depth : 0 ) . dig ( "root" , "nodeId" )
446
- end
447
-
448
448
def ws_url
449
449
"ws://#{ @browser . process . host } :#{ @browser . process . port } /devtools/page/#{ @target_id } "
450
450
end
Original file line number Diff line number Diff line change 181
181
end
182
182
183
183
it "can set page content" do
184
- browser . content = "<html><head></head><body>Voila!</body></html>"
184
+ browser . content = "<html><head></head><body>Voila! <a href='#'>Link</a> </body></html>"
185
185
186
186
expect ( browser . body ) . to include ( "Voila!" )
187
+ expect ( browser . at_css ( "a" ) . text ) . to eq ( "Link" )
187
188
end
188
189
189
190
it "gets page doctype" do
You can’t perform that action at this time.
0 commit comments