Skip to content

Commit

Permalink
Increase wait times for window_opened_by spec due to slow Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
abotalov committed Aug 24, 2014
1 parent 304e2fb commit 23c4091
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/capybara/spec/session/window/window_opened_by_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@

context 'with :wait option' do
it 'should raise error if value of :wait is less than timeout' do
Capybara.using_wait_time 1 do
# So large value is used as `driver.window_handles` takes up to 800 ms on Travis
Capybara.using_wait_time 2 do
expect do
@session.window_opened_by(wait: 0.4) do
@session.find(:css, '#openWindowWithTimeout').click
@session.window_opened_by(wait: 0.8) do
@session.find(:css, '#openWindowWithLongerTimeout').click
end
end.to raise_error(Capybara::WindowError, zero_windows_message)
end
Expand Down
9 changes: 9 additions & 0 deletions lib/capybara/spec/views/with_windows.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
return false;
});

$('#openWindowWithLongerTimeout').click(function(){
setTimeout(function(){
window.open('/popup_one', 'firstPopup');
}, 1400);
return false;
});

$('#openTwoWindows').click(function() {
window.open('/popup_one', 'firstPopup');
window.open('/popup_two', 'secondPopup');
Expand All @@ -29,6 +36,8 @@

<button id="openWindowWithTimeout">Open new window with timeout</button>

<button id="openWindowWithLongerTimeout">Open new window with longer timeout</button>

<button id="openTwoWindows">Open two windows</button>

<button id="doesNotOpenWindows">Does not open windows</button>
Expand Down

0 comments on commit 23c4091

Please sign in to comment.