Switch off resynchronization by default
This commit is contained in:
parent
6a17be4795
commit
91de98bb03
|
@ -2,7 +2,7 @@ require 'selenium-webdriver'
|
|||
|
||||
class Capybara::Selenium::Driver < Capybara::Driver::Base
|
||||
DEFAULT_OPTIONS = {
|
||||
:resynchronize => true,
|
||||
:resynchronize => false,
|
||||
:resynchronization_timeout => 10,
|
||||
:browser => :firefox
|
||||
}
|
||||
|
|
|
@ -138,6 +138,7 @@ shared_examples_for "driver with resynchronization support" do
|
|||
before { @driver.visit('/with_js') }
|
||||
describe "#find" do
|
||||
context "with synchronization turned on" do
|
||||
before { @driver.options[:resynchronize] = true }
|
||||
it "should wait for all ajax requests to finish" do
|
||||
@driver.find('//input[@id="fire_ajax_request"]').first.click
|
||||
@driver.find('//p[@id="ajax_request_done"]').should_not be_empty
|
||||
|
@ -146,16 +147,14 @@ shared_examples_for "driver with resynchronization support" do
|
|||
|
||||
context "with resynchronization turned off" do
|
||||
before { @driver.options[:resynchronize] = false }
|
||||
|
||||
it "should not wait for ajax requests to finish" do
|
||||
@driver.find('//input[@id="fire_ajax_request"]').first.click
|
||||
@driver.find('//p[@id="ajax_request_done"]').should be_empty
|
||||
end
|
||||
|
||||
after { @driver.options[:resynchronize] = true }
|
||||
end
|
||||
|
||||
context "with short synchronization timeout" do
|
||||
before { @driver.options[:resynchronize] = true }
|
||||
before { @driver.options[:resynchronization_timeout] = 0.1 }
|
||||
|
||||
it "should raise an error" do
|
||||
|
@ -163,10 +162,11 @@ shared_examples_for "driver with resynchronization support" do
|
|||
@driver.find('//input[@id="fire_ajax_request"]').first.click
|
||||
end.to raise_error(Capybara::TimeoutError, "failed to resynchronize, ajax request timed out")
|
||||
end
|
||||
|
||||
after { @driver.options[:resynchronization_timeout] = 10 }
|
||||
end
|
||||
end
|
||||
|
||||
after { @driver.options[:resynchronize] = false }
|
||||
after { @driver.options[:resynchronization_timeout] = 10 }
|
||||
end
|
||||
|
||||
shared_examples_for "driver with header support" do
|
||||
|
|
Loading…
Reference in New Issue