File tree Expand file tree Collapse file tree 4 files changed +5
-4
lines changed Expand file tree Collapse file tree 4 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 21
21
- Correctly set mouse events buttons property [ #509 ]
22
22
- Prevent 'Hash#[ ] =': can't add a new key into hash during iteration [ #513 ]
23
23
- ` Ferrum::Network::Exchange#finished? ` and ` Ferrum::Network#wait_for_idle ` take into account that request can be a blob [ #496 ]
24
+ - Safe call _ body_ method (DOM) when page is empty and no html [ #522 ]
24
25
25
26
### Removed
26
27
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ def doctype
92
92
# browser.body # => '<html itemscope="" itemtype="http://schema.org/WebPage" lang="ru"><head>...
93
93
#
94
94
def body
95
- evaluate ( "document.documentElement.outerHTML" )
95
+ evaluate ( "document.documentElement? .outerHTML" ) || ""
96
96
end
97
97
98
98
#
Original file line number Diff line number Diff line change 517
517
%r{Request to http://.*/with_js failed \( net::ERR_INTERNET_DISCONNECTED\) }
518
518
)
519
519
520
- expect ( page . at_css ( "body" ) . text ) . to match ( "No internet " )
520
+ expect ( page . at_css ( "body" ) . text ) . to match ( "" )
521
521
end
522
522
end
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def puts(*args)
19
19
browser = Ferrum ::Browser . new ( logger : logger )
20
20
browser . body
21
21
file_log = File . read ( file_path )
22
- expect ( file_log ) . to include ( "return document.documentElement.outerHTML" )
22
+ expect ( file_log ) . to include ( "return document.documentElement? .outerHTML" )
23
23
expect ( file_log ) . to include ( "<html><head></head><body></body></html>" )
24
24
ensure
25
25
FileUtils . rm_f ( file_path )
@@ -32,7 +32,7 @@ def puts(*args)
32
32
33
33
browser . body
34
34
35
- expect ( logger . string ) . to include ( "return document.documentElement.outerHTML" )
35
+ expect ( logger . string ) . to include ( "return document.documentElement? .outerHTML" )
36
36
expect ( logger . string ) . to include ( "<html><head></head><body></body></html>" )
37
37
ensure
38
38
browser . quit
You can’t perform that action at this time.
0 commit comments