Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
Testing Any Website Written in Any Language With Capybara and RSpec
Slide 2
Slide 2 text
Prem Sichanugrist @sikachu /sikachu
Slide 3
Slide 3 text
Testing
Slide 4
Slide 4 text
Acceptance Testing
Slide 5
Slide 5 text
High-level Testing
Slide 6
Slide 6 text
Assert From User's Perspective
Slide 7
Slide 7 text
Whole-Stack Testing
Slide 8
Slide 8 text
Acceptance Testing Frameworks • Cucumber (Ruby) • Mocha (JavaScript (node.js)) • Ranorex (C#, VB.NET)
Slide 9
Slide 9 text
Capybara + RSpec (Ruby)
Slide 10
Slide 10 text
Why You Should Write Acceptance Test
Slide 11
Slide 11 text
(this slide is intentionally left blank)
Slide 12
Slide 12 text
TL;DR • User flow is well-defined • Prevent future regression after introducing new feature
Slide 13
Slide 13 text
Why Capybara + Rspec?
Slide 14
Slide 14 text
Clean & Clear Syntax
Slide 15
Slide 15 text
Very Well-Maintained
Slide 16
Slide 16 text
Very Flexible Easily swapping between drivers
Slide 17
Slide 17 text
Requirements
Slide 18
Slide 18 text
Requirements 1. RSpec - Testing Framework
Slide 19
Slide 19 text
Requirements 1. RSpec - Testing Framework 2. Capybara - Providing DSL for Testing
Slide 20
Slide 20 text
Requirements 1. RSpec - Testing Framework 2. Capybara - Providing DSL for Testing 3. Capybara Webkit - Webkit Backend with JS support
Slide 21
Slide 21 text
Demo
Slide 22
Slide 22 text
Steps • Install dependencies using Bundler • RSpec, Capybara, Capybara Webkit • Run RSpec install • Require Capybara in spec_helper • Set Webkit as the driver • Done, start writing test!
Slide 23
Slide 23 text
http://git.io/bcbk-testing Demo Source Code
Slide 24
Slide 24 text
Before we're done ... • Bangkok.rb • Metting every last Saturday afternoon • http://bit.ly/bangkokrb (Google Groups) • November Meeting - November 29, 2014 • Sign up: http://bit.ly/bangkokrb-nov2014
Slide 25
Slide 25 text
Thank You! Any Questions? Code: http://git.io/bcbk-testing Slide: http://bit.ly/bcbk-testing Follow me: https://twitter.com/sikachu