SlideShare a Scribd company logo
Leave end-to-
end testing to
Capybara
                   SHIBATA Hiroshi
      Eiwa System Management,Inc.
Leave end-to-end testing to Capybara
SHIBATA Hiroshi
   a.k.a hsbt

shibata.hiroshi@gmail.com




  tDiary commiter
http://www.hsbt.org/

http://github.com/hsbt/

http://twitter.com/hsbt/
asakusa.rb
SapporoRubyKaigi
RubyKaigi 2010
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Capybara
Leave end-to-end testing to Capybara
Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
RSpec runner      cucumber runner


                  cucumber DSL(ja)

 RSpec DSL
                    cucumber DSL



             capybara
RSpec
Example
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
Cucumber
 Example
Leave end-to-end testing to Capybara
Driver
Leave end-to-end testing to Capybara
Driver
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
HtmlUnit
Leave end-to-end testing to Capybara
javascript
  engine
Leave end-to-end testing to Capybara
Selenium
Webdriver
Leave end-to-end testing to Capybara
require ‘capybara/dsl’

RSpec.configure do |config|
 config.include Capybara
 config.before(:all, :selenium => true) do
  Capybara.current_driver = :selenium
 end
end
http://www.ne.jp/asahi/t/wada/articles/Refactoring_and_Test.pdf
Leave end-to-end testing to Capybara
best mix
DSL
config.before(:all, :selenium => true) do
 Capybara.current_driver = :selenium
end

config.after(:all, :selenium => true) do
 Capybara.use_default_driver
end
DSL
feature "              ", :selenium => true do
 let!(:administrator) { User.make! }

 before do
  login_as administrator
  visit new_admin_user_path
 end

 scenario "                       " do
  (    )
 end
end
capybara/rspec
DSL
feature "            ", :driver => :akephalos do
 scenario "                     " do
  (    )
 end
end

feature "        ", :js => true do
 scenario "                     " do
  (    )
 end
end

=> :driver = :selenium
!!!
Leave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
RubyKaigi 2011
Leave end-to-end testing to Capybara

More Related Content

PDF
The details of CI/CD environment for Ruby
PDF
Gate of Agile Web Development
PDF
How to develop Jenkins plugin using to ruby and Jenkins.rb
PDF
20141210 rakuten techtalk
PDF
20140626 red dotrubyconf2014
PDF
20140925 rails pacific
PDF
20140425 ruby conftaiwan2014
PDF
20140419 oedo rubykaigi04
The details of CI/CD environment for Ruby
Gate of Agile Web Development
How to develop Jenkins plugin using to ruby and Jenkins.rb
20141210 rakuten techtalk
20140626 red dotrubyconf2014
20140925 rails pacific
20140425 ruby conftaiwan2014
20140419 oedo rubykaigi04

What's hot (20)

PDF
20140918 ruby kaigi2014
PDF
How DSL works on Ruby
PDF
mruby で mackerel のプラグインを作るはなし
PDF
How to Begin Developing Ruby Core
PDF
How to test code with mruby
KEY
tDiary annual report 2009 - Sapporo Ruby Kaigi02
PDF
Gems on Ruby
PDF
Practical ngx_mruby
PDF
Middleware as Code with mruby
PDF
Gemification plan of Standard Library on Ruby
PDF
RubyGems 3 & 4
PDF
How to develop the Standard Libraries of Ruby?
PDF
Middleware as Code with mruby
PDF
An introduction and future of Ruby coverage library
PDF
How to distribute Ruby to the world
PDF
The Future of Dependency Management for Ruby
PDF
The Future of Bundled Bundler
PDF
The Future of library dependency management of Ruby
PDF
Gemification for Ruby 2.5/3.0
ODP
Performance Optimization of Rails Applications
20140918 ruby kaigi2014
How DSL works on Ruby
mruby で mackerel のプラグインを作るはなし
How to Begin Developing Ruby Core
How to test code with mruby
tDiary annual report 2009 - Sapporo Ruby Kaigi02
Gems on Ruby
Practical ngx_mruby
Middleware as Code with mruby
Gemification plan of Standard Library on Ruby
RubyGems 3 & 4
How to develop the Standard Libraries of Ruby?
Middleware as Code with mruby
An introduction and future of Ruby coverage library
How to distribute Ruby to the world
The Future of Dependency Management for Ruby
The Future of Bundled Bundler
The Future of library dependency management of Ruby
Gemification for Ruby 2.5/3.0
Performance Optimization of Rails Applications
Ad

Similar to Leave end-to-end testing to Capybara (20)

PDF
infra-as-code
KEY
Wider than rails
PDF
Complex Made Simple: Sleep Better with TorqueBox
PDF
Advanced technic for OS upgrading in 3 minutes
KEY
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
KEY
Sinatra for REST services
PDF
Automatisation in development and testing - within budget
PDF
QConSP 2015 - Dicas de Performance para Aplicações Web
KEY
Railsconf2011 deployment tips_for_slideshare
PPTX
Sinatra
PDF
SINATRA + HAML + TWITTER
PDF
Building web framework with Rack
PDF
TDC 2012 - Patterns e Anti-Patterns em Ruby
PDF
Minimalism in Web Development
PDF
Capybara with Rspec
PDF
Lightweight Webservices with Sinatra and RestClient
KEY
Rapid Prototyping FTW!!!
PDF
Pump up the JAM with Gatsby
PDF
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
infra-as-code
Wider than rails
Complex Made Simple: Sleep Better with TorqueBox
Advanced technic for OS upgrading in 3 minutes
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Sinatra for REST services
Automatisation in development and testing - within budget
QConSP 2015 - Dicas de Performance para Aplicações Web
Railsconf2011 deployment tips_for_slideshare
Sinatra
SINATRA + HAML + TWITTER
Building web framework with Rack
TDC 2012 - Patterns e Anti-Patterns em Ruby
Minimalism in Web Development
Capybara with Rspec
Lightweight Webservices with Sinatra and RestClient
Rapid Prototyping FTW!!!
Pump up the JAM with Gatsby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Ad

More from Hiroshi SHIBATA (20)

PDF
Introduction of Cybersecurity with Ruby at RedDotRubyConf 2024
PDF
Introduction of Cybersecurity with OSS at Code Europe 2024
PDF
Long journey of Ruby Standard library at RubyKaigi 2024
PDF
Long journey of Ruby standard library at RubyConf AU 2024
PDF
Deep dive into Ruby's require - RubyConf Taiwan 2023
PDF
How resolve Gem dependencies in your code?
PDF
How resolve Gem dependencies in your code?
PDF
Ruby コミッターと歩む Ruby を用いたプロダクト開発
PDF
Why ANDPAD commit Ruby and RubyKaigi?
PDF
RailsGirls から始める エンジニアリングはじめの一歩
PDF
Dependency Resolution with Standard Libraries
PDF
Roadmap for RubyGems 4 and Bundler 3
PDF
Ruby Security the Hard Way
PDF
OSS Security the hard way
PDF
The Future of library dependency manageement of Ruby
PDF
What's new in RubyGems3
PDF
Productive Organization with Ruby
PDF
Gems on Ruby
PDF
RubyGems 3 & 4
PDF
How to distribute Ruby to the world
Introduction of Cybersecurity with Ruby at RedDotRubyConf 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby standard library at RubyConf AU 2024
Deep dive into Ruby's require - RubyConf Taiwan 2023
How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?
Ruby コミッターと歩む Ruby を用いたプロダクト開発
Why ANDPAD commit Ruby and RubyKaigi?
RailsGirls から始める エンジニアリングはじめの一歩
Dependency Resolution with Standard Libraries
Roadmap for RubyGems 4 and Bundler 3
Ruby Security the Hard Way
OSS Security the hard way
The Future of library dependency manageement of Ruby
What's new in RubyGems3
Productive Organization with Ruby
Gems on Ruby
RubyGems 3 & 4
How to distribute Ruby to the world

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Approach and Philosophy of On baking technology
PDF
KodekX | Application Modernization Development
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Cloud computing and distributed systems.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Approach and Philosophy of On baking technology
KodekX | Application Modernization Development
Spectral efficient network and resource selection model in 5G networks
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Machine learning based COVID-19 study performance prediction
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Cloud computing and distributed systems.

Leave end-to-end testing to Capybara

Editor's Notes