Capybara

2,805 views

Published on

Capybara presentation from my talk at NYC Metro Selenium Users Meetup

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,805
On SlideShare
0
From Embeds
0
Number of Embeds
467
Actions
Shares
0
Downloads
34
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Capybara

    1. 1. Capybara
    2. 2. backend for Ruby DSL Cucumber Capybara driver agnostic RackTest - Selenium - defaultdefault browser javascript driver
    3. 3. set it up !!sudo gem install capybararails app : rails generate cucumber:install --capybaranon rails app : require capybara/cucumber Capybara.app = MyRackApphttps://github.com/jnicklas/capybara
    4. 4. all about driversCapybara.javascript_driver = :seleniumCapybara.default_driver = :seleniumregister new driver Capybara.register_driver :celerity do |app| Capybara::Driver::Celerity.new(app,:browser => :chrome) endCurrently supported drivers RackTest Selenium 2.0 - Webdriver HtmlUnit - Akephalos, Celerity, Culerity Capybara-webkit
    5. 5. capybara dslnavigation - visitclicks - click_linkfinders - find_fieldmatchers - page.has_xpath?actions - fill_inscope - withinscripting - page.execute_script()http://rubydoc.info/github/jnicklas/capybara/master
    6. 6. google_steps.rbWhen /^I search google for "([^"]*)"$/ do |search_string| visit("http://google.com") fill_in (q, :with => search_string) click_button (Search)endThen /google should .+ "([^"]*)"/ do |expected_substring| page.should have_content(expected_substring)end
    7. 7. reduce build timetagginguse headless webdriver
    8. 8. what else?capybara-firebuguse capybara with rspecrun on remote server using Capybara.run_server = falsesupports both xpath and csshttp://google-opensource.blogspot.com/2009/05/introducing-webdriver.html

    ×