def close_window(handle)
raise ArgumentError, 'Not allowed to close the primary window' if handle == window_handles.first
within_given_window(handle) do
browser.close
end
end
I propose we remove this guard. Because there seems to be plenty of legitimate reasons why you may want to close the "first" window. Especially if it's not the active one. A test may cycle through three different windows and you only want the last window
FROM: https://github.com/teamcapybara/capybara/blame/b3325b198464b806f07ec2011ceb532d6d5cf4ab/lib/capybara/selenium/driver.rb#L235
I propose we remove this guard. Because there seems to be plenty of legitimate reasons why you may want to close the "first" window. Especially if it's not the active one. A test may cycle through three different windows and you only want the last window