mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Merge pull request #2354 from teamcapybara/empty_source_if_not_ready
Return empty source if not ready when using selenium
This commit is contained in:
commit
e3b2447313
3 changed files with 7 additions and 1 deletions
|
@ -19,6 +19,8 @@ Layout/EmptyLinesAroundAttributeAccessor:
|
|||
Enabled: true
|
||||
Style/SlicingWithRange:
|
||||
Enabled: true
|
||||
Lint/DeprecatedOpenSSLConstant:
|
||||
Enabled: true
|
||||
|
||||
Layout/LineLength:
|
||||
Description: 'Limit lines to 80 characters.'
|
||||
|
|
|
@ -85,6 +85,10 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
|||
|
||||
def html
|
||||
browser.page_source
|
||||
rescue Selenium::WebDriver::Error::JavascriptError => e
|
||||
return '' if e.match?(/documentElement is null/)
|
||||
|
||||
raise
|
||||
end
|
||||
|
||||
def title
|
||||
|
|
|
@ -46,7 +46,7 @@ module Capybara
|
|||
end
|
||||
|
||||
def edge?(session)
|
||||
browser_name(session).match?(/^edge/)
|
||||
browser_name(session).to_s.start_with?('edge')
|
||||
end
|
||||
|
||||
def legacy_edge?(session)
|
||||
|
|
Loading…
Add table
Reference in a new issue