SlideShare a Scribd company logo
StevenYap
stevenyap@futureworkz.com
https://github.com/stevenyap
Capybara testing
A Garden City
A Lion City
Capybara testing
• Host Saigon.rb Ruby Meetup
• Co-Founder of Futureworkz
• Ruby on Rails coder
• Agile startup consultant
Awesome Ruby on Rails Development
http://www.futureworkz.com
http://playbook.futureworkz.com/
CAPYBARA TESTING
STEVEN YAP
CAPYBARA TESTING BY STEVEN YAP
WHAT IS CAPYBARA TESTING?
▸ Capybara is a gem for feature test (a.k.a. integration test)
▸ Loads your app in a browser and runs a test like a user
CAPYBARA TESTING BY STEVEN YAP
WHY DO CAPYBARA TESTING?
▸ Ensure all models/controllers/views are working together
▸ Ensure important user interactions are working
▸ Tests/Works with external scripts/windows such as Google
Map API, Paypal Sandbox
CAPYBARA TESTING BY STEVEN YAP
I HATE CAPYBARA TESTING!!!
▸ Slow
▸ Very slow
▸ Very very slow
▸ Breakable
▸ Very breakable
▸ Very very breakable
▸ Hard to debug
▸ Very hard to debug
▸ Very very hard to debug
CAPYBARA TESTING BY STEVEN YAP
WHERE TO APPLY CAPYBARA TESTING?
▸ Minimise number of capybara tests
▸ Happy paths
▸ Critical functions
WHEN I PUSH A MAJOR FEATURE TO
PRODUCTION,
I FEEL SAFER WHEN MY CAPYBARA
TESTS PASSED
Steven Yap
CAPYBARA TESTING BY STEVEN YAP
WHY SO SLOW?
CAPYBARA TESTING BY STEVEN YAP
WHY IS CAPYBARA TESTS SO SLOW?
▸ Loads entire app stack
▸ Calls many controllers/models/views
▸ By default, capybara does not run JS
CAPYBARA TESTING BY STEVEN YAP
RUNNING JAVASCRIPT WITH CAPYBARA
▸ https://rubygems.org/gems/selenium-webdriver/versions/
2.48.1 with Firefox
▸ https://github.com/thoughtbot/capybara-webkit with Qt
▸ https://github.com/teampoltergeist/poltergeist with
PhantomJS
▸ Add ‘js: true’ to your test case
CAPYBARA TESTING BY STEVEN YAP
WHY IS CAPYBARA TESTS SO SLOW?
▸ Loads entire app stack
▸ Runs Javascript including AJAX calls
▸ Loads external scripts such as Google fonts, CDN
Javascript libraries, etc (and executes it)
▸ Fully functional browser to test on
▸ Poor coding
CAPYBARA TESTING BY STEVEN YAP
POOR CODING
▸ Bloated CSS
▸ Slow/Too many AJAX calls
▸ Poor performance (eg. N + 1 queries)
▸ Too many external scripts (eg. 2 x date-picker libraries, full
modernizr library for video checking only)
CAPYBARA TESTING BY STEVEN YAP
DATABASE CLEANER
▸ Problem: Created user cannot login in Capybara JS test
▸ Reason: Javascript driver runs in a separate process from
database
▸ Solution: Change from transaction to truncation using
https://github.com/DatabaseCleaner/database_cleaner
▸ Read more: https://github.com/DatabaseCleaner/
database_cleaner#rspec-with-capybara-example
CAPYBARA TESTING BY STEVEN YAP
EXCLUDE CAPYBARA TEST
▸ RSpec.configure do |config|

config.filter_run_excluding(:js) unless ENV['ALL']

end
▸ rspec

=> will not run capybara tests
▸ ALL=1 rspec

=> will run all tests including capybara
WHY SO
BREAKABLE?
CAPYBARA TESTING BY STEVEN YAP
WHY IS CAPYBARA SO BREAKABLE?
▸ Failed tests in model/controller
▸ Text changes
▸ Design changes (eg. layout)
CAPYBARA TESTING BY STEVEN YAP
TARGET ELEMENT WISELY
▸ Use “within ‘#modal’ { }” to scope your targeting
▸ Avoid targeting an element by text or label
▸ Target an element by ID or field name
▸ Target an element by class
CAPYBARA TESTING BY STEVEN YAP
GOOD USE OF CSS CLASS NAME + SEMANTIC HTML
▸ Descriptive CSS class naming: 

<button class=“green” />
▸ Functional CSS class naming: 

<button class=“submit-button” />
▸ Non-semantic HTML:

<div class=“wrapper”><h1>Product Title</h1></div>
▸ Semantic HTML:

<div class=“product wrapper”>

<h1 class=“title”>Product Title</h1>

</div>
WHY SO
HARD TO DEBUG?
CAPYBARA TESTING BY STEVEN YAP
TOO MANY THINGS HAPPENING!
▸ Asset pipeline, Javascript functions, CSS rendering, partials,
controllers, models, database, EVERYTHING!!!
▸ Failure can come from anywhere (unlike functional/unit tests)
▸ External script loads too slow (timeout)
▸ Performance too bad (AJAX call timeout)
▸ Errors in assets compilation (SASS error)
▸ Javascript driver bugs
CAPYBARA TESTING BY STEVEN YAP
THINK LIKE A USER
▸ Capybara tests run like a real user using the site
▸ Anything your users cannot do = Your test cannot do
▸ User cannot post to a URL directly so your test code cannot
post to a URL directly like a controller test
▸ User cannot click on hidden elements (eg. a hidden link)
CAPYBARA TESTING BY STEVEN YAP
CAPYBARA DEBUGGING METHODS
▸ Make sure your development site works first!
▸ https://github.com/jnicklas/capybara#debugging
▸ https://github.com/mattheworiordan/capybara-screenshot
▸ Painful examination of rendered HTML
CAPYBARA TESTING BY STEVEN YAP
OVERLAYED ELEMENTS VS HIDDEN ELEMENTS
▸ Sometimes CSS styling overlay the original element with
another layout
▸ Eg. http://materializecss.com/forms.html#checkbox
▸ Forced click:

page.find(‘#user_terms_and_conditions’, visible:
false).trigger('click')
CAPYBARA TESTING BY STEVEN YAP
AJAX CALLS
▸ Difficult to debug
▸ Is the AJAX fired or fired with errors?
▸ Console.log() will output when running the test
▸ Understand when Capybara will wait or will not wait
▸ https://github.com/jnicklas/capybara#asynchronous-
javascript-ajax-and-friends
CAPYBARA TESTING BY STEVEN YAP
ACTIONVIEW::TEMPLATE::ERROR: END OF FILE REACHED
▸ Random bug that appeared
▸ https://github.com/jfirebaugh/konacha/issues/123
▸ Reason: sprockets reading uncompiled asset files
▸ Solution: gem 'sprockets-rails', '~> 3.0.0', :require =>
'sprockets/railtie'
PAYPAL SANDBOX
CAPYBARA TESTING BY STEVEN YAP
PAYPAL SANDBOX
def make_payment_via_paypal()
using_wait_time(30) do
resolve_paypal_js_error
click_on 'Pay with my PayPal account'
within '#method-paypal' do
fill_in 'Email', with: Rails.application.secrets.paypal_testing_email
fill_in 'PayPal password', with: Rails.application.secrets.paypal_testing_password
click_on 'Log In'
end
find('#continue_abovefold').click
expect(page).not_to have_content 'Loading...'
end
end
# Paypal has a JS error
# where it cannot find div#paywithmybank_container
def resolve_paypal_js_error
execute_script <<-EOF
var ele = document.createElement("DIV");
ele.id = "paywithmybank_container";
document.getElementsByTagName("body")[0].appendChild(ele);
EOF
end
CAPYBARA TESTING BY STEVEN YAP
DO CAPYBARA TEST
▸ It is the Ultimate Test
▸ Give assurances to critical functions
▸ Helps you to think about your views
▸ Easier with experience
Thank you!
Awesome Ruby on Rails Development
http://www.futureworkz.com
http://playbook.futureworkz.com/

More Related Content

PDF
Rspec and Capybara Intro Tutorial at RailsConf 2013
PDF
Jest: Frontend Testing leicht gemacht @EnterJS2018
PDF
Acceptance Test-driven Development with Cucumber-jvm
PPTX
Automated Testing with Cucumber, PhantomJS and Selenium
PDF
APIs: A Better Alternative to Page Objects
PDF
Testing Code.org's Interactive CS Curriculum
PDF
The Many Ways to Test Your React App
PDF
Lunch and learn: Cucumber and Capybara
Rspec and Capybara Intro Tutorial at RailsConf 2013
Jest: Frontend Testing leicht gemacht @EnterJS2018
Acceptance Test-driven Development with Cucumber-jvm
Automated Testing with Cucumber, PhantomJS and Selenium
APIs: A Better Alternative to Page Objects
Testing Code.org's Interactive CS Curriculum
The Many Ways to Test Your React App
Lunch and learn: Cucumber and Capybara

What's hot (20)

PPTX
Test automation with Cucumber-JVM
PDF
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
PDF
Jest: Frontend Testing richtig gemacht @WebworkerNRW
PPTX
Making Watir and Cucumber an efficient tool for Web UI Automation
PDF
Better Page Object Handling with Loadable Component Pattern
KEY
Integration Testing With Cucumber How To Test Anything J A O O 2009
PDF
The LAZY Developer's Guide to BDD (with Cucumber)
PDF
Automate Thyself
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
PDF
Behavior Driven Development and Automation Testing Using Cucumber
PPTX
Integration Testing with Selenium
PDF
How do I Write Testable Javascript so I can Test my CF API on Server and Client
PPTX
Introduction to cypress in Angular (Chinese)
PDF
Conquering AngularJS Limitations
PDF
Continuous Integration Testing in Django
PDF
Front-End Testing: Demystified
PDF
Automated Testing in Angular Slides
PDF
Das Frontend richtig Testen – mit Jest @Developer Week 2018
PPTX
Protractor Tutorial Quality in Agile 2015
PDF
Writing Software not Code with Cucumber
Test automation with Cucumber-JVM
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Jest: Frontend Testing richtig gemacht @WebworkerNRW
Making Watir and Cucumber an efficient tool for Web UI Automation
Better Page Object Handling with Loadable Component Pattern
Integration Testing With Cucumber How To Test Anything J A O O 2009
The LAZY Developer's Guide to BDD (with Cucumber)
Automate Thyself
Better End-to-End Testing with Page Objects Model using Protractor
Behavior Driven Development and Automation Testing Using Cucumber
Integration Testing with Selenium
How do I Write Testable Javascript so I can Test my CF API on Server and Client
Introduction to cypress in Angular (Chinese)
Conquering AngularJS Limitations
Continuous Integration Testing in Django
Front-End Testing: Demystified
Automated Testing in Angular Slides
Das Frontend richtig Testen – mit Jest @Developer Week 2018
Protractor Tutorial Quality in Agile 2015
Writing Software not Code with Cucumber
Ad

Viewers also liked (20)

PDF
Testing Microservices with a Citrus twist
PDF
Bdd (Behavior Driven Development)
PPTX
Testing Java EE apps with Arquillian
PPTX
Workshop calabash appium
PDF
Arquillian & Citrus
PPTX
Pruebas funcionales de Software
PPTX
Automated Acceptance Tests & Tool choice
PDF
Three Uses Of JIRA Beyond Bug Tracking
PPT
TestLink introduction
PDF
Introduction To Confluence
PPTX
Jira as a Tool for Test Management
PPT
Using JIRA Software for Issue Tracking
PDF
Introduction To Jira
PPTX
Story Testing Approach for Enterprise Applications using Selenium Framework
PPTX
Next level of Appium
PPTX
Automate you Appium test like a pro!
PPTX
Gerrit is Getting Native with RPM, Deb and Docker
PPTX
Introduction to Bdd and cucumber
PDF
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
PDF
Continuous integration using Jenkins and Sonar
Testing Microservices with a Citrus twist
Bdd (Behavior Driven Development)
Testing Java EE apps with Arquillian
Workshop calabash appium
Arquillian & Citrus
Pruebas funcionales de Software
Automated Acceptance Tests & Tool choice
Three Uses Of JIRA Beyond Bug Tracking
TestLink introduction
Introduction To Confluence
Jira as a Tool for Test Management
Using JIRA Software for Issue Tracking
Introduction To Jira
Story Testing Approach for Enterprise Applications using Selenium Framework
Next level of Appium
Automate you Appium test like a pro!
Gerrit is Getting Native with RPM, Deb and Docker
Introduction to Bdd and cucumber
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
Continuous integration using Jenkins and Sonar
Ad

Similar to Capybara testing (20)

PDF
Testing Ember Apps
PDF
Capybara with Rspec
KEY
Capybara-Webkit
PDF
DevTeach12-Capybara
PDF
RSpec on Rails Tutorial
PPTX
Capybara and cucumber with DSL using ruby
PDF
Embracing Capybara
PDF
Webdriver.io
PDF
YEG-UG-Capybara
PDF
Taming the Testing Beast - AgileDC 2012
PPTX
SPA 2009 - Acceptance Testing AJAX Web Applications through the GUI
PPTX
Rspec presentation
PPTX
Capybara + RSpec - ruby dsl-based web ui qa automation
PDF
Selenium Basics
PPTX
UI Tests Are Fun To Write (If You Write Them Right)
PPTX
Cucumber_Capybara
PDF
The Testing Planet - July 2010
PPTX
Java script unit testing
PDF
Functional testing with capybara
PDF
Capybara
Testing Ember Apps
Capybara with Rspec
Capybara-Webkit
DevTeach12-Capybara
RSpec on Rails Tutorial
Capybara and cucumber with DSL using ruby
Embracing Capybara
Webdriver.io
YEG-UG-Capybara
Taming the Testing Beast - AgileDC 2012
SPA 2009 - Acceptance Testing AJAX Web Applications through the GUI
Rspec presentation
Capybara + RSpec - ruby dsl-based web ui qa automation
Selenium Basics
UI Tests Are Fun To Write (If You Write Them Right)
Cucumber_Capybara
The Testing Planet - July 2010
Java script unit testing
Functional testing with capybara
Capybara

Recently uploaded (20)

PPTX
Transform Your Business with a Software ERP System
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
L1 - Introduction to python Backend.pptx
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
System and Network Administraation Chapter 3
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
history of c programming in notes for students .pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Nekopoi APK 2025 free lastest update
PPTX
ai tools demonstartion for schools and inter college
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
medical staffing services at VALiNTRY
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
Transform Your Business with a Software ERP System
Navsoft: AI-Powered Business Solutions & Custom Software Development
Upgrade and Innovation Strategies for SAP ERP Customers
L1 - Introduction to python Backend.pptx
Odoo Companies in India – Driving Business Transformation.pdf
System and Network Administraation Chapter 3
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
history of c programming in notes for students .pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
How Creative Agencies Leverage Project Management Software.pdf
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Understanding Forklifts - TECH EHS Solution
CHAPTER 2 - PM Management and IT Context
Nekopoi APK 2025 free lastest update
ai tools demonstartion for schools and inter college
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
medical staffing services at VALiNTRY
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Migrate SBCGlobal Email to Yahoo Easily

Capybara testing

  • 6. • Host Saigon.rb Ruby Meetup • Co-Founder of Futureworkz • Ruby on Rails coder • Agile startup consultant
  • 7. Awesome Ruby on Rails Development http://www.futureworkz.com http://playbook.futureworkz.com/
  • 9. CAPYBARA TESTING BY STEVEN YAP WHAT IS CAPYBARA TESTING? ▸ Capybara is a gem for feature test (a.k.a. integration test) ▸ Loads your app in a browser and runs a test like a user
  • 10. CAPYBARA TESTING BY STEVEN YAP WHY DO CAPYBARA TESTING? ▸ Ensure all models/controllers/views are working together ▸ Ensure important user interactions are working ▸ Tests/Works with external scripts/windows such as Google Map API, Paypal Sandbox
  • 11. CAPYBARA TESTING BY STEVEN YAP I HATE CAPYBARA TESTING!!! ▸ Slow ▸ Very slow ▸ Very very slow ▸ Breakable ▸ Very breakable ▸ Very very breakable ▸ Hard to debug ▸ Very hard to debug ▸ Very very hard to debug
  • 12. CAPYBARA TESTING BY STEVEN YAP WHERE TO APPLY CAPYBARA TESTING? ▸ Minimise number of capybara tests ▸ Happy paths ▸ Critical functions
  • 13. WHEN I PUSH A MAJOR FEATURE TO PRODUCTION, I FEEL SAFER WHEN MY CAPYBARA TESTS PASSED Steven Yap CAPYBARA TESTING BY STEVEN YAP
  • 15. CAPYBARA TESTING BY STEVEN YAP WHY IS CAPYBARA TESTS SO SLOW? ▸ Loads entire app stack ▸ Calls many controllers/models/views ▸ By default, capybara does not run JS
  • 16. CAPYBARA TESTING BY STEVEN YAP RUNNING JAVASCRIPT WITH CAPYBARA ▸ https://rubygems.org/gems/selenium-webdriver/versions/ 2.48.1 with Firefox ▸ https://github.com/thoughtbot/capybara-webkit with Qt ▸ https://github.com/teampoltergeist/poltergeist with PhantomJS ▸ Add ‘js: true’ to your test case
  • 17. CAPYBARA TESTING BY STEVEN YAP WHY IS CAPYBARA TESTS SO SLOW? ▸ Loads entire app stack ▸ Runs Javascript including AJAX calls ▸ Loads external scripts such as Google fonts, CDN Javascript libraries, etc (and executes it) ▸ Fully functional browser to test on ▸ Poor coding
  • 18. CAPYBARA TESTING BY STEVEN YAP POOR CODING ▸ Bloated CSS ▸ Slow/Too many AJAX calls ▸ Poor performance (eg. N + 1 queries) ▸ Too many external scripts (eg. 2 x date-picker libraries, full modernizr library for video checking only)
  • 19. CAPYBARA TESTING BY STEVEN YAP DATABASE CLEANER ▸ Problem: Created user cannot login in Capybara JS test ▸ Reason: Javascript driver runs in a separate process from database ▸ Solution: Change from transaction to truncation using https://github.com/DatabaseCleaner/database_cleaner ▸ Read more: https://github.com/DatabaseCleaner/ database_cleaner#rspec-with-capybara-example
  • 20. CAPYBARA TESTING BY STEVEN YAP EXCLUDE CAPYBARA TEST ▸ RSpec.configure do |config|
 config.filter_run_excluding(:js) unless ENV['ALL']
 end ▸ rspec
 => will not run capybara tests ▸ ALL=1 rspec
 => will run all tests including capybara
  • 22. CAPYBARA TESTING BY STEVEN YAP WHY IS CAPYBARA SO BREAKABLE? ▸ Failed tests in model/controller ▸ Text changes ▸ Design changes (eg. layout)
  • 23. CAPYBARA TESTING BY STEVEN YAP TARGET ELEMENT WISELY ▸ Use “within ‘#modal’ { }” to scope your targeting ▸ Avoid targeting an element by text or label ▸ Target an element by ID or field name ▸ Target an element by class
  • 24. CAPYBARA TESTING BY STEVEN YAP GOOD USE OF CSS CLASS NAME + SEMANTIC HTML ▸ Descriptive CSS class naming: 
 <button class=“green” /> ▸ Functional CSS class naming: 
 <button class=“submit-button” /> ▸ Non-semantic HTML:
 <div class=“wrapper”><h1>Product Title</h1></div> ▸ Semantic HTML:
 <div class=“product wrapper”>
 <h1 class=“title”>Product Title</h1>
 </div>
  • 25. WHY SO HARD TO DEBUG?
  • 26. CAPYBARA TESTING BY STEVEN YAP TOO MANY THINGS HAPPENING! ▸ Asset pipeline, Javascript functions, CSS rendering, partials, controllers, models, database, EVERYTHING!!! ▸ Failure can come from anywhere (unlike functional/unit tests) ▸ External script loads too slow (timeout) ▸ Performance too bad (AJAX call timeout) ▸ Errors in assets compilation (SASS error) ▸ Javascript driver bugs
  • 27. CAPYBARA TESTING BY STEVEN YAP THINK LIKE A USER ▸ Capybara tests run like a real user using the site ▸ Anything your users cannot do = Your test cannot do ▸ User cannot post to a URL directly so your test code cannot post to a URL directly like a controller test ▸ User cannot click on hidden elements (eg. a hidden link)
  • 28. CAPYBARA TESTING BY STEVEN YAP CAPYBARA DEBUGGING METHODS ▸ Make sure your development site works first! ▸ https://github.com/jnicklas/capybara#debugging ▸ https://github.com/mattheworiordan/capybara-screenshot ▸ Painful examination of rendered HTML
  • 29. CAPYBARA TESTING BY STEVEN YAP OVERLAYED ELEMENTS VS HIDDEN ELEMENTS ▸ Sometimes CSS styling overlay the original element with another layout ▸ Eg. http://materializecss.com/forms.html#checkbox ▸ Forced click:
 page.find(‘#user_terms_and_conditions’, visible: false).trigger('click')
  • 30. CAPYBARA TESTING BY STEVEN YAP AJAX CALLS ▸ Difficult to debug ▸ Is the AJAX fired or fired with errors? ▸ Console.log() will output when running the test ▸ Understand when Capybara will wait or will not wait ▸ https://github.com/jnicklas/capybara#asynchronous- javascript-ajax-and-friends
  • 31. CAPYBARA TESTING BY STEVEN YAP ACTIONVIEW::TEMPLATE::ERROR: END OF FILE REACHED ▸ Random bug that appeared ▸ https://github.com/jfirebaugh/konacha/issues/123 ▸ Reason: sprockets reading uncompiled asset files ▸ Solution: gem 'sprockets-rails', '~> 3.0.0', :require => 'sprockets/railtie'
  • 33. CAPYBARA TESTING BY STEVEN YAP PAYPAL SANDBOX def make_payment_via_paypal() using_wait_time(30) do resolve_paypal_js_error click_on 'Pay with my PayPal account' within '#method-paypal' do fill_in 'Email', with: Rails.application.secrets.paypal_testing_email fill_in 'PayPal password', with: Rails.application.secrets.paypal_testing_password click_on 'Log In' end find('#continue_abovefold').click expect(page).not_to have_content 'Loading...' end end # Paypal has a JS error # where it cannot find div#paywithmybank_container def resolve_paypal_js_error execute_script <<-EOF var ele = document.createElement("DIV"); ele.id = "paywithmybank_container"; document.getElementsByTagName("body")[0].appendChild(ele); EOF end
  • 34. CAPYBARA TESTING BY STEVEN YAP DO CAPYBARA TEST ▸ It is the Ultimate Test ▸ Give assurances to critical functions ▸ Helps you to think about your views ▸ Easier with experience
  • 35. Thank you! Awesome Ruby on Rails Development http://www.futureworkz.com http://playbook.futureworkz.com/