lib/capybara/window.rb in capybara-3.21.0 vs lib/capybara/window.rb in capybara-3.22.0
- old
+ new
@@ -1,25 +1,25 @@
# frozen_string_literal: true
module Capybara
##
- # The Window class represents a browser window.
+ # The {Window} class represents a browser window.
#
# You can get an instance of the class by calling either of:
#
# * {Capybara::Session#windows}
# * {Capybara::Session#current_window}
# * {Capybara::Session#window_opened_by}
# * {Capybara::Session#switch_to_window}
#
# Note that some drivers (e.g. Selenium) support getting size of/resizing/closing only
- # current window. So if you invoke such method for:
+ # current window. So if you invoke such method for:
#
- # * window that is current, Capybara will make 2 Selenium method invocations
- # (get handle of current window + get size/resize/close).
- # * window that is not current, Capybara will make 4 Selenium method invocations
- # (get handle of current window + switch to given handle + get size/resize/close + switch to original handle)
+ # * window that is current, Capybara will make 2 Selenium method invocations
+ # (get handle of current window + get size/resize/close).
+ # * window that is not current, Capybara will make 4 Selenium method invocations
+ # (get handle of current window + switch to given handle + get size/resize/close + switch to original handle)
#
class Window
# @return [String] a string that uniquely identifies window within session
attr_reader :handle
@@ -55,16 +55,16 @@
##
# Close window.
#
# If this method was called for window that is current, then after calling this method
- # future invocations of other Capybara methods should raise
- # `session.driver.no_such_window_error` until another window will be switched to.
+ # future invocations of other Capybara methods should raise
+ # {Capybara::Driver::Base#no_such_window_error session.driver.no_such_window_error} until another window will be switched to.
#
# @!macro about_current
# If this method was called for window that is not current, then after calling this method
- # current window shouldn remain the same as it was before calling this method.
+ # current window should remain the same as it was before calling this method.
#
def close
@driver.close_window(handle)
end
@@ -91,10 +91,10 @@
##
# Maximize window.
#
# If a particular driver (e.g. headless driver) doesn't have concept of maximizing it
- # may not support this method.
+ # may not support this method.
#
# @macro about_current
#
def maximize
wait_for_stable_size { @driver.maximize_window(handle) }