Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Leave end-to-end testing to Capybara

SHIBATA Hiroshi
October 11, 2011
610

Leave end-to-end testing to Capybara

SHIBATA Hiroshi

October 11, 2011
Tweet

Transcript

  1. DSL feature '೔هΛಡΉ' 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"]') ! end end
  2. feature "͓٬༷৽ن௥Ճ", :selenium => true do let!(:administrator) { User.make! }

    before do login_as administrator visit new_admin_user_path end scenario "؅ཧऀΛొ࿥Ͱ͖Δ͜ͱ" do (লུ) end end DSL
  3. DSL feature "͓٬༷৽ن௥Ճ", :driver => :akephalos do scenario "؅ཧऀΛొ࿥Ͱ͖Δ͜ͱ" do

    (লུ) end end feature "͓٬༷มߋ", :js => true do scenario "؅ཧऀΛมߋͰ͖Δ͜ͱ" do (লུ) end end => :driver = :selenium ͱಉ͡