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
57
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
WebGIS AI Agentの紹介
_shimizu
0
590
AIエージェントとPhysical AIが拓く製造業の変革(ハノーバーメッセリキャップ)
iotcomjpadmin
0
160
作る力から、見極める力へ — AI時代に広がるエンジニアの価値と役割
rince
0
360
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
190
Deep Data Security 機能解説
oracle4engineer
PRO
2
230
AI時代における最適なQA組織の作り方
ymty
3
160
CVE-2026-20833_脆弱性対応とAES 化について
jukishiya
0
130
「勝手に広まる」人気 AI エージェントを爆速で作ろう!(AWS Summit Japan 2026講演資料)
minorun365
PRO
10
2.6k
Why is RC4 still being used?
tamaiyutaro
0
110
AIチャットの改善から見えた、良いAI体験とは / What Constitutes a Good AI Experience: Insights from Improving AI Chat
kubode
0
130
現場のトークンマネジメント
dak2
1
200
SRE歴2ヶ月でも開発6年の知見を活かして、チームで止まっていた環境改善を前に進めた話
a_ono
0
110
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
210
WCS-LA-2024
lcolladotor
0
660
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
350
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
620
How to Ace a Technical Interview
jacobian
281
24k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
370
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
300
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
400
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
Designing Powerful Visuals for Engaging Learning
tmiket
1
430
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