Capybara

Mona Soni
Mona SoniDirector of Test Engineering at Amplify um Amplify
Capybara
backend for
  Ruby DSL                              Cucumber
                  Capybara
                  driver agnostic

  RackTest -                        Selenium - default
default browser                      javascript driver
set it up !!

sudo gem install capybara

rails app : rails generate cucumber:install --
capybara

non rails app :

   require 'capybara/cucumber'

   Capybara.app = MyRackApp

https://github.com/jnicklas/capybara
all about drivers
Capybara.javascript_driver = :selenium

Capybara.default_driver = :selenium

register new driver

  Capybara.register_driver :celerity do |app|
  Capybara::Driver::Celerity.new(app,:browser
  => :chrome) end

Currently supported drivers

  RackTest

  Selenium 2.0 - Webdriver

  HtmlUnit - Akephalos, Celerity, Culerity

  Capybara-webkit
capybara dsl
navigation - visit

clicks - click_link

finders - find_field

matchers - page.has_xpath?

actions - fill_in

scope - within

scripting - page.execute_script()

http://rubydoc.info/github/jnicklas/capybara/master
google_steps.rb


When /^I search google for "([^"]*)"$/ do |search_string|
      visit("http://google.com")
      fill_in ('q', :with => search_string)
      click_button ('Search')
end


Then /google should .+ "([^"]*)"/ do |expected_substring|
      page.should have_content(expected_substring)
end
reduce build time


tagging

use headless webdriver
what else?
capybara-firebug

use capybara with rspec

run on remote server using

    Capybara.run_server = false

supports both xpath and css

http://google-opensource.blogspot.com/2009/05/introducing-
webdriver.html
1 von 8

Recomendados

Capybara + RSpec - ruby dsl-based web ui qa automation von
Capybara + RSpec - ruby dsl-based web ui qa automationCapybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automationCOMAQA.BY
1.5K views15 Folien
Capybara with Rspec von
Capybara with RspecCapybara with Rspec
Capybara with RspecOmnia Helmi
9.7K views17 Folien
Put a Button on It: Removing Barriers to Going Fast von
Put a Button on It: Removing Barriers to Going FastPut a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going FastOSCON Byrum
10.3K views97 Folien
Ansible von
AnsibleAnsible
AnsibleVishal Yadav
5K views39 Folien
Creating applications with Grails, Angular JS and Spring Security von
Creating applications with Grails, Angular JS and Spring SecurityCreating applications with Grails, Angular JS and Spring Security
Creating applications with Grails, Angular JS and Spring SecurityAlvaro Sanchez-Mariscal
6.4K views32 Folien
Ansible 101 - Presentation at Ansible STL Meetup von
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupJeff Geerling
1.8K views24 Folien

Más contenido relacionado

Was ist angesagt?

Introduction to ansible galaxy von
Introduction to ansible galaxyIntroduction to ansible galaxy
Introduction to ansible galaxyIvan Serdyuk
316 views33 Folien
Mastering Grails 3 Plugins - GR8Conf EU 2016 von
Mastering Grails 3 Plugins - GR8Conf EU 2016Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Alvaro Sanchez-Mariscal
969 views46 Folien
Impression of Rails 3 von
Impression of Rails 3Impression of Rails 3
Impression of Rails 3Kosuke Matsuda
532 views53 Folien
NodeWay in my project & sails.js von
NodeWay in my project & sails.jsNodeWay in my project & sails.js
NodeWay in my project & sails.jsDmytro Ovcharenko
5.7K views154 Folien
Rails with mongodb von
Rails with mongodbRails with mongodb
Rails with mongodbKosuke Matsuda
1.5K views21 Folien
FITC - Here Be Dragons: Advanced JavaScript Debugging von
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingRami Sayar
1.1K views40 Folien

Was ist angesagt?(20)

Introduction to ansible galaxy von Ivan Serdyuk
Introduction to ansible galaxyIntroduction to ansible galaxy
Introduction to ansible galaxy
Ivan Serdyuk316 views
FITC - Here Be Dragons: Advanced JavaScript Debugging von Rami Sayar
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript Debugging
Rami Sayar1.1K views
Azkaban and Pig at LinkedIn von Russell Jurney
Azkaban and Pig at LinkedInAzkaban and Pig at LinkedIn
Azkaban and Pig at LinkedIn
Russell Jurney2.8K views
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv... von Marco Obinu
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...
SQL Start! 2019 - Ancona - Distribuisci ed amministra le tue istanze SQL Serv...
Marco Obinu72 views
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all! von tdc-globalcode
TDC2016SP -  Esqueça Grunt ou Gulp. Webpack and NPM rule them all!TDC2016SP -  Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
tdc-globalcode401 views
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan von Adler Hsieh
Automating Your Daily Tasks with Scripting - RubyConf 2015 TaiwanAutomating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Automating Your Daily Tasks with Scripting - RubyConf 2015 Taiwan
Adler Hsieh6.6K views
Putting the 'ctions' in Azure Fun-ctions von NullOps
Putting the 'ctions' in Azure Fun-ctionsPutting the 'ctions' in Azure Fun-ctions
Putting the 'ctions' in Azure Fun-ctions
NullOps227 views
Webpack & React Performance in 16+ Steps von Grgur Grisogono
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ Steps
Grgur Grisogono4.9K views
Packing for the Web with Webpack von Thiago Temple
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with Webpack
Thiago Temple834 views
Big Data DC - BenchPress von Drew Stephens
Big Data DC - BenchPressBig Data DC - BenchPress
Big Data DC - BenchPress
Drew Stephens1.1K views
Rails after 5 years von Rob Dawson
Rails after 5 yearsRails after 5 years
Rails after 5 years
Rob Dawson334 views

Destacado

Jenkins CI von
Jenkins CIJenkins CI
Jenkins CIhaochenglee
28.1K views63 Folien
Introduction To Django (Strange Loop 2011) von
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Jacob Kaplan-Moss
14.4K views139 Folien
Make It Cooler: Using Decentralized Version Control von
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Controlindiver
3.8K views45 Folien
A quick python_tour von
A quick python_tourA quick python_tour
A quick python_tourcghtkh
1.1K views17 Folien
Outside-In Development With Cucumber von
Outside-In Development With CucumberOutside-In Development With Cucumber
Outside-In Development With CucumberBen Mabey
15.2K views137 Folien
Prepare for JDK 9 von
Prepare for JDK 9Prepare for JDK 9
Prepare for JDK 9haochenglee
526 views44 Folien

Destacado(10)

Introduction To Django (Strange Loop 2011) von Jacob Kaplan-Moss
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)
Jacob Kaplan-Moss14.4K views
Make It Cooler: Using Decentralized Version Control von indiver
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
indiver3.8K views
A quick python_tour von cghtkh
A quick python_tourA quick python_tour
A quick python_tour
cghtkh1.1K views
Outside-In Development With Cucumber von Ben Mabey
Outside-In Development With CucumberOutside-In Development With Cucumber
Outside-In Development With Cucumber
Ben Mabey15.2K views
Two scoops of Django - Security Best Practices von Spin Lai
Two scoops of Django - Security Best PracticesTwo scoops of Django - Security Best Practices
Two scoops of Django - Security Best Practices
Spin Lai5.9K views
The WHY behind TDD/BDD and the HOW with RSpec von Ben Mabey
The WHY behind TDD/BDD and the HOW with RSpecThe WHY behind TDD/BDD and the HOW with RSpec
The WHY behind TDD/BDD and the HOW with RSpec
Ben Mabey7K views

Similar a Capybara

Capybara and cucumber with DSL using ruby von
Capybara and cucumber with DSL using rubyCapybara and cucumber with DSL using ruby
Capybara and cucumber with DSL using rubyDeepak Chandella
236 views47 Folien
Cucumber von
CucumberCucumber
CucumberBachue Zhou
5.3K views16 Folien
Cross-browser testing in the real world von
Cross-browser testing in the real worldCross-browser testing in the real world
Cross-browser testing in the real worldMartin Kleppmann
5.3K views111 Folien
Autotesting rails app von
Autotesting rails appAutotesting rails app
Autotesting rails appAnton Naumenko
537 views37 Folien
Fisl - Deployment von
Fisl - DeploymentFisl - Deployment
Fisl - DeploymentFabio Akita
934 views191 Folien
Deployment de Rails von
Deployment de RailsDeployment de Rails
Deployment de Railselliando dias
1.1K views191 Folien

Similar a Capybara(20)

Capybara and cucumber with DSL using ruby von Deepak Chandella
Capybara and cucumber with DSL using rubyCapybara and cucumber with DSL using ruby
Capybara and cucumber with DSL using ruby
Deepak Chandella236 views
Cross-browser testing in the real world von Martin Kleppmann
Cross-browser testing in the real worldCross-browser testing in the real world
Cross-browser testing in the real world
Martin Kleppmann5.3K views
Padrino - the Godfather of Sinatra von Stoyan Zhekov
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
Stoyan Zhekov7.5K views
Dynamic Languages & Web Frameworks in GlassFish von IndicThreads
Dynamic Languages & Web Frameworks in GlassFishDynamic Languages & Web Frameworks in GlassFish
Dynamic Languages & Web Frameworks in GlassFish
IndicThreads1.5K views
Leave end-to-end testing to Capybara von Hiroshi SHIBATA
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
Hiroshi SHIBATA2.3K views
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016] von Brice Argenson
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]
Brice Argenson358 views
Jenkins and rails app - Le Dinh Vu von Framgia Vietnam
Jenkins and rails app - Le Dinh VuJenkins and rails app - Le Dinh Vu
Jenkins and rails app - Le Dinh Vu
Framgia Vietnam2.1K views
1st Chinaonrails Open Course 高级战略 von Jesse Cai
1st Chinaonrails Open Course 高级战略1st Chinaonrails Open Course 高级战略
1st Chinaonrails Open Course 高级战略
Jesse Cai467 views
5 Takeaways from Migrating a Library to Scala 3 - Scala Love von Natan Silnitsky
5 Takeaways from Migrating a Library to Scala 3 - Scala Love5 Takeaways from Migrating a Library to Scala 3 - Scala Love
5 Takeaways from Migrating a Library to Scala 3 - Scala Love
Natan Silnitsky424 views
Asset Pipeline in Ruby on Rails von RORLAB
Asset Pipeline in Ruby on RailsAsset Pipeline in Ruby on Rails
Asset Pipeline in Ruby on Rails
RORLAB4.1K views
JRuby on Rails Deployment: What They Didn't Tell You von elliando dias
JRuby on Rails Deployment: What They Didn't Tell YouJRuby on Rails Deployment: What They Didn't Tell You
JRuby on Rails Deployment: What They Didn't Tell You
elliando dias3.9K views
Instrumentación de entrega continua con Gitlab von Software Guru
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
Software Guru429 views
Vue 淺談前端建置工具 von andyyou
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
andyyou 2.2K views

Último

Digital Personal Data Protection (DPDP) Practical Approach For CISOs von
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOsPriyanka Aash
162 views59 Folien
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... von
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...ShapeBlue
171 views28 Folien
"Node.js Development in 2024: trends and tools", Nikita Galkin von
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin Fwdays
33 views38 Folien
LLMs in Production: Tooling, Process, and Team Structure von
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team StructureAggregage
57 views77 Folien
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... von
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...ShapeBlue
164 views13 Folien
Why and How CloudStack at weSystems - Stephan Bienek - weSystems von
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsShapeBlue
247 views13 Folien

Último(20)

Digital Personal Data Protection (DPDP) Practical Approach For CISOs von Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash162 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... von ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue171 views
"Node.js Development in 2024: trends and tools", Nikita Galkin von Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays33 views
LLMs in Production: Tooling, Process, and Team Structure von Aggregage
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team Structure
Aggregage57 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... von ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue164 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems von ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue247 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... von Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro35 views
Future of AR - Facebook Presentation von Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty65 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... von The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... von ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue183 views
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ... von ShapeBlue
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
Live Demo Showcase: Unveiling Dell PowerFlex’s IaaS Capabilities with Apache ...
ShapeBlue129 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue von ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue139 views
Initiating and Advancing Your Strategic GIS Governance Strategy von Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software184 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... von ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue199 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue von ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue152 views
State of the Union - Rohit Yadav - Apache CloudStack von ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue303 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... von ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue120 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... von ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue141 views

Capybara

  • 2. backend for Ruby DSL Cucumber Capybara driver agnostic RackTest - Selenium - default default browser javascript driver
  • 3. set it up !! sudo gem install capybara rails app : rails generate cucumber:install -- capybara non rails app : require 'capybara/cucumber' Capybara.app = MyRackApp https://github.com/jnicklas/capybara
  • 4. all about drivers Capybara.javascript_driver = :selenium Capybara.default_driver = :selenium register new driver Capybara.register_driver :celerity do |app| Capybara::Driver::Celerity.new(app,:browser => :chrome) end Currently supported drivers RackTest Selenium 2.0 - Webdriver HtmlUnit - Akephalos, Celerity, Culerity Capybara-webkit
  • 5. capybara dsl navigation - visit clicks - click_link finders - find_field matchers - page.has_xpath? actions - fill_in scope - within scripting - page.execute_script() http://rubydoc.info/github/jnicklas/capybara/master
  • 6. google_steps.rb When /^I search google for "([^"]*)"$/ do |search_string| visit("http://google.com") fill_in ('q', :with => search_string) click_button ('Search') end Then /google should .+ "([^"]*)"/ do |expected_substring| page.should have_content(expected_substring) end
  • 7. reduce build time tagging use headless webdriver
  • 8. what else? capybara-firebug use capybara with rspec run on remote server using Capybara.run_server = false supports both xpath and css http://google-opensource.blogspot.com/2009/05/introducing- webdriver.html

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n