Update capybara
This commit is contained in:
parent
c2b93cdfd8
commit
1bb387928c
63
capybara.md
63
capybara.md
|
@ -106,41 +106,46 @@ should_not doesn't wait for a timeout from the driver
|
||||||
.current_path
|
.current_path
|
||||||
.current_url
|
.current_url
|
||||||
|
|
||||||
|
## AJAX
|
||||||
|
|
||||||
|
using_wait_time(10) { ... }
|
||||||
|
|
||||||
## Misc
|
## Misc
|
||||||
|
|
||||||
drag
|
drag
|
||||||
field_labeled
|
field_labeled
|
||||||
wait_until
|
|
||||||
|
|
||||||
## Capybara RSpec matchers
|
## Capybara RSpec matchers
|
||||||
|
|
||||||
# all selectors have:
|
```rb
|
||||||
text: 'welcome'
|
# all selectors have...
|
||||||
visible: true
|
text: 'welcome'
|
||||||
count: 4
|
visible: true
|
||||||
between: 2..5
|
count: 4
|
||||||
minimum: 2
|
between: 2..5
|
||||||
maximum: 5
|
minimum: 2
|
||||||
wait: N # has_text
|
maximum: 5
|
||||||
|
wait: N # has_text
|
||||||
|
|
||||||
expect(page).to have_selector '.blank-state'
|
expect(page).to have_selector '.blank-state'
|
||||||
expect(page).to have_selector 'h1#hola', text: 'Welcome'
|
expect(page).to have_selector 'h1#hola', text: 'Welcome'
|
||||||
expect(page).to have_button
|
expect(page).to have_button
|
||||||
expect(page).to have_checked_field
|
expect(page).to have_checked_field
|
||||||
expect(page).to have_css '...'
|
expect(page).to have_css '...'
|
||||||
expect(page).to have_field
|
expect(page).to have_field
|
||||||
expect(page).to have_link 'Logout',
|
expect(page).to have_link 'Logout',
|
||||||
href: logout_path
|
href: logout_path
|
||||||
expect(page).to have_select 'Language',
|
expect(page).to have_select 'Language',
|
||||||
selected: 'German'
|
selected: 'German'
|
||||||
options: ['Engish', 'German']
|
options: ['Engish', 'German']
|
||||||
with_options: ['Engish', 'German'] # partial match
|
with_options: ['Engish', 'German'] # partial match
|
||||||
expect(page).to have_table '#table'
|
expect(page).to have_table '#table'
|
||||||
expect(page).to have_text 'Hello',
|
expect(page).to have_text 'Hello',
|
||||||
type: :visible | :all
|
type: :visible | :all
|
||||||
# alias: have_content
|
# alias: have_content
|
||||||
expect(page).to have_unchecked_field
|
expect(page).to have_unchecked_field
|
||||||
expect(page).to have_xpath
|
expect(page).to have_xpath
|
||||||
|
```
|
||||||
|
|
||||||
http://rubydoc.info/github/jnicklas/capybara/Capybara/RSpecMatchers
|
- <http://rubydoc.info/github/jnicklas/capybara/Capybara/RSpecMatchers>
|
||||||
http://www.rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Matchers
|
- <http://www.rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Matchers>
|
||||||
|
|
Loading…
Reference in New Issue