class Capybara::Window

def exists?

Returns:
  • (Boolean) - whether the window is not closed
def exists?
  @driver.window_handles.include?(@handle)
end