Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Testing Any Website Written in Any Language Wit...
Search
Prem Sichanugrist
November 16, 2014
Technology
1
160
Testing Any Website Written in Any Language With Capybara and RSpec
Presented at Barcamp Bangkhen 2014 on November 16, 2014.
Prem Sichanugrist
November 16, 2014
Tweet
Share
More Decks by Prem Sichanugrist
See All by Prem Sichanugrist
Working with Huge Databases and Tables
sikachu
1
82
What's coming in Rails 5.2, and sneak peek into Rails 6
sikachu
6
5.9k
Zero-downtime payment platforms
sikachu
2
240
Introduction to Active Support
sikachu
0
160
Hidden gems in Ruby on Rails
sikachu
5
260
Active Support Secrets
sikachu
1
250
Dependencies Testing With Appraisal And Bundler
sikachu
1
280
You have to test multiple versions of your gem's dependencies. You used Appraisal. It's super affective!
sikachu
0
300
Zero-downtime payment platforms
sikachu
1
120
Other Decks in Technology
See All in Technology
PHPカンファレンス名古屋-テックリードの経験から学んだ設計の教訓
hayatokudou
0
220
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
2
180
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
960
Swiftの “private” を テストする / Testing Swift "private"
yutailang0119
0
130
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.6k
室長と気ままに学ぶマイクロソフトのビジネスアプリケーションとビジネスプロセス
ryoheig0405
0
360
CZII - CryoET Object Identification 参加振り返り・解法共有
tattaka
0
350
スタートアップ1人目QAエンジニアが QAチームを立ち上げ、“個”からチーム、 そして“組織”に成長するまで / How to set up QA team at reiwatravel
mii3king
2
1.4k
Larkご案内資料
customercloud
PRO
0
650
モノレポ開発のエラー、誰が見る?Datadog で実現する適切なトリアージとエスカレーション
biwashi
6
800
関東Kaggler会LT: 人狼コンペとLLM量子化について
nejumi
3
570
ハッキングの世界に迫る~攻撃者の思考で考えるセキュリティ~
nomizone
13
5.2k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Into the Great Unknown - MozCon
thekraken
35
1.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Scaling GitHub
holman
459
140k
BBQ
matthewcrist
87
9.5k
Music & Morning Musume
bryan
46
6.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
A Tale of Four Properties
chriscoyier
158
23k
Transcript
Testing Any Website Written in Any Language With Capybara and
RSpec
Prem Sichanugrist @sikachu /sikachu
Testing
Acceptance Testing
High-level Testing
Assert From User's Perspective
Whole-Stack Testing
Acceptance Testing Frameworks • Cucumber (Ruby) • Mocha (JavaScript (node.js))
• Ranorex (C#, VB.NET)
Capybara + RSpec (Ruby)
Why You Should Write Acceptance Test
(this slide is intentionally left blank)
TL;DR • User flow is well-defined • Prevent future regression
after introducing new feature
Why Capybara + Rspec?
Clean & Clear Syntax
Very Well-Maintained
Very Flexible Easily swapping between drivers
Requirements
Requirements 1. RSpec - Testing Framework
Requirements 1. RSpec - Testing Framework 2. Capybara - Providing
DSL for Testing
Requirements 1. RSpec - Testing Framework 2. Capybara - Providing
DSL for Testing 3. Capybara Webkit - Webkit Backend with JS support
Demo
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!
http://git.io/bcbk-testing Demo Source Code
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
Thank You! Any Questions? Code: http://git.io/bcbk-testing Slide: http://bit.ly/bcbk-testing Follow me:
https://twitter.com/sikachu