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
Integration Testing
Search
Ivan Kerin
April 25, 2014
Technology
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Integration Testing
Ivan Kerin
April 25, 2014
More Decks by Ivan Kerin
See All by Ivan Kerin
OpenBuildings Modules
ivank
1
140
Other Decks in Technology
See All in Technology
ブラウザで変わるID連携(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
350
Digitization部 紹介資料
sansan33
PRO
2
7.8k
[RSJ26] Flow as Flow: Modeling Robot Velocity Fields as Probability Velocity Fields
keio_smilab
PRO
0
110
IHV like なユースケースへのOpenID Connect 関連仕様の適用事例
optim
0
360
サービス内で複数のOP・ASを連鎖させる(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
350
Windows の互換機能 - 古いプログラムはなぜ動作できるのか
murachiakira
PRO
0
130
markdown-poster Introduction
kazamori
0
400
AI駆動開発はどこまで来たのか? ファインディの最新実態調査で読み解く現在地 Devin Con Tokyo
akiratom
4
1.9k
OAuth SPIFFE Client Authentication(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
350
NANDでも描画したい!
nichica906
3
810
[ホンマでっか SRE] あなたはなぜ SRE に?
_awache
0
360
ハッカソンで入賞した話 @ Findy LT
asari194617
0
1.5k
Featured
See All Featured
Visualization
eitanlees
152
17k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Making Projects Easy
brettharned
120
6.7k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
950
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
290
How STYLIGHT went responsive
nonsquared
100
6.2k
New Earth Scene 8
popppiees
3
2.5k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
450
Transcript
Integration Testing
Lets do Tests Need Test! ???
High Level Integration Testing • Encompass a lot of functionality
• Don’t concentrate on edge cases • Test user experience, not implementation • Testing has to be easy™
Gotchas • Slow tests don’t get run • “Develop →
Test → Deploy” cycle • Unenforced tests don’t get run • Tests must be isolated
Spiderling • Spiderling https://github.com/OpenBuildings/spiderling • PHPUnit Spiderling https://github.com/OpenBuildings/phpunit-spiderling • DB
Fixtures https://github.com/OpenBuildings/db-fixtures • Functest https://github.com/OpenBuildings/functest • Env Backup https://github.com/clippings/env-backup
Example Test Cycle • Import SQL dump, or run fixtures
to generate one (DB Fixtures) • Set all global state to known values (Env Backup) • Start DB Transaction • Optionally Start Browser / phantomjs • Run tests • Rollback DB Transaction • Rollback global state
Example • Go to edit my profile page • Enter
Your Email! • Enter First Name • Enter Last Name • Enter About You • Upload Image Your photo! • Press Save Button! • Validate saved data
<?php! ! class MeTest extends Testcase_Functest {! ! ! !
public function test_me_edit()! ! {! ! ! $user = $this->login();! ! ! ! $this->visit('me/edit');! ! ! $this->assertHasCss('h3', array('text' =>'Edit your profile'));! ! ! ! $this->fill_in('Your Email', '
[email protected]
');! ! ! $this->fill_in('First name', 'Bob');! ! ! $this->fill_in('Last name', 'Smith');! ! ! $this->fill_in('description', 'new description');! ! ! $this->attach_file('Your Photo', APPPATH.'tests/image1.jpg');! ! ! ! $this->click_button('Save Profile');! ! ! ! $this->assertHasCss('.notification.success', array('text' => 'Updated'));! ! ! ! $updated_user = Jam::find('user', $user->id());! ! ! ! $this->assertEquals(Resource::url($updated_user), $this->current_path());! ! ! $this->assertEquals('
[email protected]
', $updated_user->email);! ! ! $this->assertEquals('Bob', $updated_user->first_name);! ! ! $this->assertEquals('Smith', $updated_user->last_name);! ! ! $this->assertEquals('image1.jpg', $updated_user->avatar->filename());! ! ! $this->assertEquals('new description', $updated_user->description);! ! }! }!
Selenium class MeTest extends Testcase_Functest {! ! ! /**! !
* @driver selenium! ! */! ! public function test_me_edit()! ! {! ! ! $user = $this->login();! ! ! ! $this->visit('me/edit');! ! ! $this->assertHasCss('h3', array('text' =>'Edit your profile'));! composer require claylo/selenium-server-standalone:dev-master! composer install! ! xvfb-run java -jar vendor/claylo/selenium-server-standalone/selenium-server-standalone-2.*.jar
Phantomjs class MeTest extends Testcase_Functest {! ! ! /**! !
* @driver phantomjs! ! */! ! public function test_me_edit()! ! {! ! ! $user = $this->login();! ! ! ! $this->visit('me/edit');! ! ! $this->assertHasCss('h3', array('text' =>'Edit your profile'));!
Checking Errors • PHPUnit assertion failures • application/logs/<year>/<month>/<day>.php
Functest Errors
Debugging ! public function test_me_edit()! ! {! ! ! $user
= $this->login();! ! ! ! $this->visit('me/edit');! ! ! $this->assertHasCss('h3', array('text' =>'Edit not your profile'));! ! ! ! echo $this->find('h3');! ! ! $this->screenshot(APPROOT.'application/logs/testimage.png');! ! ! ! $this->fill_in('Your Email', '
[email protected]
');! ! ! $this->fill_in('description', 'new description');! ! ! ! $this->click_button('Save Profile');! ! }!
CI Failure Logs
None