spec/watirspec/window_switching_spec.rb in watir-6.19.0 vs spec/watirspec/window_switching_spec.rb in watir-6.19.1

- old
+ new

@@ -101,9 +101,18 @@ expect { browser.window(handle: 'bar').use }.to raise_no_matching_window_exception end end describe '#switch_window' do + it 'stays on the same window when matches single window' do + browser.switch_window + browser.window.close + browser.original_window.use + + title = browser.title + expect { browser.window(title: title).use }.not_to raise_exception(TimeoutError) + end + it 'switches to second window' do original_window = browser.window browser.switch_window new_window = browser.window