You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ElementProxy#present? accesses the element and retries on Capybara::ElementNotFound until Capybara.default_wait_time.
When the underlying element is found, it is cached so subsequent calls through ElementProxy don't incur another lookup.
ElementProxy#not_present? was intended to work the same way, whereby the underlying element is accessed and retries until it is no longer present (i.e. absent) on the page.
However, due to the element caching, if not_present? is called after the underlying element has been cached, the page is not polled for the absence of the element.
not_present? should work just like present? and poll the page until the underlying element is not present.
Additionally, the query methods present? and not_present? do not communicate to the reader that the page is polled and the presence or absence of the element is queried until achieved. In some tests, these methods are called with the intent of waiting and in others these methods are called with the intent of querying the state of the element.
ElementProxy was introduced so the presence of elements on the page could be queried.
ElementProxy#present?
accesses the element and retries onCapybara::ElementNotFound
untilCapybara.default_wait_time
.When the underlying element is found, it is cached so subsequent calls through ElementProxy don't incur another lookup.
ElementProxy#not_present?
was intended to work the same way, whereby the underlying element is accessed and retries until it is no longer present (i.e. absent) on the page.However, due to the element caching, if
not_present?
is called after the underlying element has been cached, the page is not polled for the absence of the element.not_present?
should work just likepresent?
and poll the page until the underlying element is not present.Additionally, the query methods
present?
andnot_present?
do not communicate to the reader that the page is polled and the presence or absence of the element is queried until achieved. In some tests, these methods are called with the intent of waiting and in others these methods are called with the intent of querying the state of the element.With the intent of waiting:
With the intent of querying:
While the underlying implementation should wait for the state in both cases, the methods called should reflect the intent.
The following reads much better:
With the intent of waiting:
With the intent of querying:
The text was updated successfully, but these errors were encountered: