Skip to content

Commit

Permalink
improve test reliability when checking page title
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Mar 9, 2017
1 parent c14cd5b commit 5859253
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/capybara/spec/session/window/within_window_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
window = (@session.windows - [@window]).first
expect(@session.driver).to receive(:switch_to_window).exactly(5).times.and_call_original
@session.within_window window do
expect(['Title of the first popup', 'Title of popup two']).to include(@session.title)
expect(@session).to have_title(/Title of the first popup|Title of popup two/)
end
expect(@session.title).to eq('With Windows')
end
Expand Down Expand Up @@ -140,7 +140,7 @@
it "should find window by handle" do
window = (@session.windows - [@window]).first
@session.within_window window.handle do
expect(['Title of the first popup', 'Title of popup two']).to include(@session.title)
expect(@session).to have_title(/Title of the first popup|Title of popup two/)
end
end

Expand Down

0 comments on commit 5859253

Please sign in to comment.