Skip to content

Commit

Permalink
[rb] checking wrong public method for full page screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jan 22, 2024
1 parent 11c799a commit 5040a5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rb/lib/selenium/webdriver/common/takes_screenshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def save_screenshot(png_path, full_page: false)
# @api public

def screenshot_as(format, full_page: false)
if full_page && !respond_to?(:full_page)
if full_page && !respond_to?(:save_full_page_screenshot)
raise Error::UnsupportedOperationError, "Full Page Screenshots are not supported for #{inspect}"
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def save_screenshot_and_assert(source, path)
expect(height).to be > viewport_height
end

it 'does not take full page screenshot', except: {browser: :firefox} do
it 'does not take full page screenshot', only: {browser: %i[chrome edge safari safari_preview],
reason: 'these browsers do not implement this feature'} do
expect {
driver.save_screenshot path, full_page: true
}.to raise_exception(Error::UnsupportedOperationError, /Full Page Screenshots are not supported/)
Expand Down

0 comments on commit 5040a5a

Please sign in to comment.