1
0
Fork 0
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:
Thomas Walpole 2020-05-23 13:25:33 -07:00 committed by GitHub
commit e3b2447313
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -19,6 +19,8 @@ Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Style/SlicingWithRange:
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Layout/LineLength:
Description: 'Limit lines to 80 characters.'

View file

@ -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

View file

@ -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)