/usr/lib/ruby/vendor_ruby/capybara/spec/session/window/current_window_spec.rb is in ruby-capybara 2.5.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Capybara::SpecHelper.spec '#current_window', requires: [:windows] do
before(:each) do
@window = @session.current_window
@session.visit('/with_windows')
end
after(:each) do
(@session.windows - [@window]).each do |w|
@session.switch_to_window w
w.close
end
@session.switch_to_window(@window)
end
it 'should return window' do
expect(@session.current_window).to be_instance_of(Capybara::Window)
end
it "should be modified by switching to another window" do
window = @session.window_opened_by { @session.find(:css, '#openWindow').click }
expect do
@session.switch_to_window(window)
end.to change { @session.current_window }.from(@window).to(window)
end
end
|