Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Integration Testing
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
300
Refining Active Record
shugo
0
150
継続的なAIコスト最適化
bgpat
1
340
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
140
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
340
パッチ更新でterraform initが落ちた日
grimoh
1
140
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
940
Rust で関数型ドメインモデリング
takonda
0
140
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
770
大型犬好きによるPugの紹介
yamanoku
1
160
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
A Tale of Four Properties
chriscoyier
163
24k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
The Curse of the Amulet
leimatthew05
3
16k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
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