Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Testing Any Website Written in Any Language With Capybara and RSpec
Prem Sichanugrist
November 16, 2014
Technology
1
140
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
41
What's coming in Rails 5.2, and sneak peek into Rails 6
sikachu
6
5.7k
Zero-downtime payment platforms
sikachu
2
220
Introduction to Active Support
sikachu
0
83
Hidden gems in Ruby on Rails
sikachu
5
230
Active Support Secrets
sikachu
1
220
Dependencies Testing With Appraisal And Bundler
sikachu
1
94
You have to test multiple versions of your gem's dependencies. You used Appraisal. It's super affective!
sikachu
0
120
Zero-downtime payment platforms
sikachu
1
99
Other Decks in Technology
See All in Technology
読者のことを考えて書いてみよう / Write with your reader in mind
line_developers
PRO
3
350
[SRE NEXT 2022]ヤプリのSREにおけるセキュリティ強化の取り組みを公開する
mmochi23
1
370
実験!カオスエンジニアリング / How to Chaos Engineering
oracle4engineer
PRO
0
140
How We Foster Reliability in Diversity
nari_ex
PRO
9
2.5k
YAMLを書くだけで構築できる分散ストレージ
sat
PRO
0
180
プロダクトグロースと技術のベースアップを両立させるRettyのアプリ開発スタイル / Achieve Product Growth and Tech Update
imaizume
1
290
Dagu | オンプレ向けワークフローエンジン(WebUI 同梱)
yohamta
0
130
Team building programs for Engineering Team at Torana, Inc
memory1994
PRO
0
110
開発者のための GitHub Organization の安全な運用と 継続的なモニタリング
flatt_security
3
3.6k
TypeScript 4.7と型レベルプログラミング
uhyo
6
3.4k
LINEスタンプの実例紹介 小さく始める障害検知・対応・振り返りの 改善プラクティス
line_developers
PRO
3
1.4k
LINEのData Platform室が実践する大規模分散環境のCapacity Planning
line_developers
PRO
0
340
Featured
See All Featured
Facilitating Awesome Meetings
lara
29
3.9k
Producing Creativity
orderedlist
PRO
333
37k
Web development in the modern age
philhawksworth
197
9.3k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
11
4.6k
Building Your Own Lightsaber
phodgson
94
4.6k
Practical Orchestrator
shlominoach
178
8.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
7
1k
Ruby is Unlike a Banana
tanoku
91
9.2k
Bash Introduction
62gerente
596
210k
Designing for humans not robots
tammielis
241
23k
Pencils Down: Stop Designing & Start Developing
hursman
112
9.8k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
19
1.4k
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