Last active
August 29, 2015 14:07
-
-
Save titusfortner/4c9c489598bbb0d852b4 to your computer and use it in GitHub Desktop.
Failing Wait Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should not throw error when running error checks on closed window" do | |
browser.close | |
client = Selenium::WebDriver::Remote::Http::Default.new | |
client.timeout = 5 | |
browser = Watir::Browser.start(WatirSpec.url_for("window_switching.html"), :chrome, http_client: client) | |
browser.a(:id => "open").click | |
window = browser.window(:title => "closeable window") | |
window.use | |
browser.a(:id => "close").click | |
expect { browser.driver.current_url }.to_not raise_error | |
expect(window).to_not be_present | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should not throw error when running error checks on closed window" do | |
module Watir | |
class Browser | |
def run_checkers | |
@error_checkers.each { |e| e.call(self) } if window.present? | |
end | |
end | |
end | |
browser.goto WatirSpec.url_for("window_switching.html") | |
browser.a(:id => "open").click | |
window = browser.window(:title => "closeable window") | |
window.use | |
expect { browser.a(:id => "close").click }.to_not raise_error | |
expect(window).to_not be_present | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current Code fails in Firefox with the correct error & in Chrome with the wrong error
Desired code works in Chrome, but fails in Firefox.