We attempted to track in-progress replies and abort them in 1.5.1.
However, sometimes these replies are destroyed unexpectedly, so
attempting to abort them raises errors.
This commit tracks when replies are destroyed and removes them from the
queue of in-progress replies.
If an Ajax request finished after a `reset` triggered an alert, a native
alert pops up. Additionally, the next request to the driver after the
native alert will crash the webkit process.
* Adds `allow_url`, `block_url`, and `block_unknown_url` methods.
* Both allow_url and block_url accept wildcards.
* Any requests to blocked URLs will be blocked immediately.
* Blocked URLs take precedence over allowed URLs.
* By default, any requests to localhost and 127.0.0.1 are allowed.
* By default, any requests to unknown hosts will print a warning.
* `block_unknown_urls` causes unknown hosts to be silently blocked.
* `blacklisted_urls=` is deprecated in favor of `block_url`.
NetworkAccessManager was getting pretty complex, and adding something
that modifies or intercepts requests is becoming a common change.
This change introduces a chain of handlers which can modify a request or
return a response of their own.
To start with, this extracts the concerns of fixing missing content
types, setting custom headers, and intercepting blacklisted requests.
This adds support for the full Capybara 2.3.0 API. There are two known
incompatibilities:
* Selenium supports outerWidth and outerHeight, which we cannot, because we
dont' have an actual OS window.
* Selenium raises errors after interacting with a closed window. We focus the
next available window after closing.
This commit adds the following:
* Implement Driver#close_window
* Implement Driver#current_window_handle
* Implement Driver#maximize_window
* Implement Driver#open_new_window
* Implement Driver#no_such_window_error
* Implement Driver#resize_window_to
* Implement Driver#switch_to_window
* Implement Driver#window_size
* Implement Driver#go_back
* Implement Driver#go_forward
* Support change events when clearing a text input
* Support setting contentEditable elements
* Support window.close() in JavaScript
* Don't return text from hidden elements
* Skip Capybara specs which use outerWidth, outerHeight
* Don't use Qt object ownership to manage windows
Destroying the NetworkAccessManager seems to result in "terminate called
without an active exception" segfaults. The documentation states that an
application requires only a single single NetworkAccessManager.
Instead of emitting loadStarted when a reply is created and pageFinished
when all pending replies have finished, emit these signals when the
corresponding WebPage events fire.
Timeouts can be set using browser.timeout = <seconds>.
When a command or page load takes longer the specified
timeout a Capybara::TimeoutError will be raised. Calls
to reset! will reset the timeout. You can also clear
the timeout by setting it to -1.
The timeout is implemented as a Command decorator.