Leave end-to-end testing to Capybara

  • 3,701 views
Uploaded on

大江戸Ruby会議01

大江戸Ruby会議01

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • My thoughts about Cucumber and new Capybara DSL, checkout at http://inancgumus.com/66712574
    Are you sure you want to
    Your message goes here
  • high quality☆ reasonable price☆
    free shi pping accept pay pal,
    you can order all kind of things you want,
    believe me , trust me .
    ☆☆☆ www.happyshopping100.com -=★
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
3,701
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
35
Comments
2
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. Leave end-to-end testing toCapybara SHIBATA Hiroshi Eiwa System Management,Inc.
  • 2. SHIBATA Hiroshi a.k.a hsbtshibata.hiroshi@gmail.com tDiary commiter
  • 3. http://www.hsbt.org/http://github.com/hsbt/http://twitter.com/hsbt/
  • 4. asakusa.rb
  • 5. SapporoRubyKaigi
  • 6. RubyKaigi 2010
  • 7. Capybara
  • 8. Capybara
  • 9. RSpec runner cucumber runner cucumber DSL(ja) RSpec DSL cucumber DSL capybara
  • 10. RSpecExample
  • 11. DSLfeature do background do setup_tdiary end scenario do visit / within(title) do page.should have_content( ) } end within(h1) do page.should have_content( ) end page.should have_css(a[href="update.rb"]) endend
  • 12. Cucumber Example
  • 13. Driver
  • 14. Driver
  • 15. HtmlUnit
  • 16. javascript engine
  • 17. SeleniumWebdriver
  • 18. require ‘capybara/dsl’RSpec.configure do |config| config.include Capybara config.before(:all, :selenium => true) do Capybara.current_driver = :selenium endend
  • 19. http://www.ne.jp/asahi/t/wada/articles/Refactoring_and_Test.pdf
  • 20. best mix
  • 21. DSLconfig.before(:all, :selenium => true) do Capybara.current_driver = :seleniumendconfig.after(:all, :selenium => true) do Capybara.use_default_driverend
  • 22. DSLfeature " ", :selenium => true do let!(:administrator) { User.make! } before do login_as administrator visit new_admin_user_path end scenario " " do ( ) endend
  • 23. capybara/rspec
  • 24. DSLfeature " ", :driver => :akephalos do scenario " " do ( ) endendfeature " ", :js => true do scenario " " do ( ) endend=> :driver = :selenium
  • 25. !!!
  • 26. RubyKaigi 2011