mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
More clarification in the README
This commit is contained in:
parent
e608340b6e
commit
b5c20fb6a6
1 changed files with 16 additions and 0 deletions
16
README.rdoc
16
README.rdoc
|
@ -495,6 +495,22 @@ is (the default is 2 seconds):
|
||||||
|
|
||||||
Capybara.default_wait_time = 5
|
Capybara.default_wait_time = 5
|
||||||
|
|
||||||
|
Be aware that because of this behaviour, the following two statements are *not*
|
||||||
|
equivalent, and you should *always* use the latter!
|
||||||
|
|
||||||
|
!page.has_xpath?('a')
|
||||||
|
page.has_no_xpath?('a')
|
||||||
|
|
||||||
|
The former would immediately fail because the content has not yet been removed.
|
||||||
|
Only the latter would wait for the asynchronous process to remove the content
|
||||||
|
from the page.
|
||||||
|
|
||||||
|
Capybara's Rspec matchers, however, are smart enough to handle either form.
|
||||||
|
The two following statements are functionally equivalent:
|
||||||
|
|
||||||
|
page.should_not have_xpath('a')
|
||||||
|
page.should have_no_xpath('a')
|
||||||
|
|
||||||
Capybara's waiting behaviour is quite advanced, and can deal with situations
|
Capybara's waiting behaviour is quite advanced, and can deal with situations
|
||||||
such as the following line of code:
|
such as the following line of code:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue