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 With Capybara and RSpec
Search
Prem Sichanugrist
November 16, 2014
Technology
1
150
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
55
What's coming in Rails 5.2, and sneak peek into Rails 6
sikachu
6
5.8k
Zero-downtime payment platforms
sikachu
2
230
Introduction to Active Support
sikachu
0
130
Hidden gems in Ruby on Rails
sikachu
5
250
Active Support Secrets
sikachu
1
230
Dependencies Testing With Appraisal And Bundler
sikachu
1
150
You have to test multiple versions of your gem's dependencies. You used Appraisal. It's super affective!
sikachu
0
210
Zero-downtime payment platforms
sikachu
1
110
Other Decks in Technology
See All in Technology
BDD(Cucumber)コミュニティが無料提供しているコンテンツの紹介と現在起きている危機
nihonbuson
4
750
生成AIの不確実性と向き合うためのオブジェクト指向設計
tkikuchi1002
2
700
やっていきテスト
k6s4i53rx
0
160
任意コード実行の原理
ffri
0
190
オブジェクトのおしゃべり大失敗 メッセージングアンチパターン集 / messaging anti-pattern collection
ytake
0
340
長文から長文を生成するLLMツールをオープンソースで作ってみた。
tomohisa
2
150
暗黙知を集積するプラットフォーム : 「健常者エミュレータ事例集」の取り組み
sora32127
1
170
XRミーティング 2024-03-20
1ftseabass
PRO
0
100
技術広報経験0のEMがエンジニアブランディングをはじめてみた
coconala_engineer
1
140
Code Smells @Voxxed Bucharest 24
victorrentea
2
220
技術イベントはなんとかひねり出す 日経の技術広報の取り組み/techpr3
nishiuma
0
230
大規模データとの戦い方
knih
1
480
Featured
See All Featured
Visualization
eitanlees
135
14k
Side Projects
sachag
451
41k
StorybookのUI Testing Handbookを読んだ
zakiyama
10
4.5k
KATA
mclloyd
14
11k
Happy Clients
brianwarren
91
6.3k
Statistics for Hackers
jakevdp
789
220k
Facilitating Awesome Meetings
lara
39
5.5k
The Art of Programming - Codeland 2020
erikaheidi
40
12k
Building Flexible Design Systems
yeseniaperezcruz
317
37k
Rails Girls Zürich Keynote
gr2m
91
13k
Writing Fast Ruby
sferik
619
59k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.8k
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