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
E2E Test Tips
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
はない
August 28, 2016
Technology
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
E2E Test Tips
Symfony Meetup #14資料
はない
August 28, 2016
More Decks by はない
See All by はない
2018年目標を達成できなかった私が 今年こそ達成するためにしていること
hanahiroaze
3
550
組み合わせテストを簡単にするgemを作った話
hanahiroaze
0
280
MySQLとデッドロックの話
hanahiroaze
1
1.4k
ここが変だよ。このテスト〜テストケース爆発と戦う〜
hanahiroaze
1
1.7k
Symfony Best Practiceを読もう!(ついでに翻訳した話)
hanahiroaze
2
950
テストことはじめ
hanahiroaze
0
520
Symfony2のi18n対応
hanahiroaze
0
860
開発合宿に行ってきました
hanahiroaze
0
160
GitHubよちよち会#3
hanahiroaze
0
180
Other Decks in Technology
See All in Technology
SREでアラート疲れを 解決しよう!
kairim0
1
120
今こそ知りたいAmplifyGen2
mkdev10
2
110
Swap and Memory Reclaim - Squeezing Out More RAM
ennael
PRO
1
1.6k
生成AIで高い生産性を求められて、 悩み、乗り越えた話
mot_techtalk
2
100
HacobuにおけるFDEとは/登壇資料(戸井田 裕貴)
hacobu
PRO
1
730
いちAWSエンジニアのAI活用を振り返る #devio2026 / devio osaka 2026 kawahara
masahirokawahara
2
340
IoTデバイスを繋げるプロトコルMatterをAndroidで使用する方法
harutiro
0
110
形式手法を使って仕様をコーディングしよう
mikanichinose
0
170
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
180
Meet AgentCore Identity Consent Portal
hironobuiga
3
180
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
160
Claude Designがめちゃくちゃ便利なので使ってほしい
diggymo
0
280
Featured
See All Featured
Fireside Chat
paigeccino
43
4k
Paper Plane
katiecoart
PRO
4
53k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Documentation Writing (for coders)
carmenintech
77
5.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
440
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
700
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Transcript
&&ςετ5JQT !IBOBIJSP@B[F
ͳ·͑ɿՖҪɹߦ UXJUUFSɿ!IBOBIJSP@B[F ॴଐɿIJUPNFEJB 4ZNGPOZྺɿ̍ 99
継続的デリバリー p129 技術視点 ビジネス視点 支 援 評 価 機能の受け入れ テスト ユニットテスト
インテグレーションテスト システムテスト ショーケース(デモなど) ユーザビリティテスト 探索的テスト 非機能の受け入れテスト (キャパシティ/セキュリティなど) リグレッション テスト 前回の復習
「同じ機能に対して手動テストを2回以上 行っていることに気づいたら、 その機能がこの先変更されるかどうか 確かめてみる。」 変更がなさそうなら自動化する。 よく変更されるなら自動化から外す。 継続的デリバリー p139-140 前回の復習
None
http://codeception.com/ https://www.browserstack.com/
"require": { "phpunit/phpunit": "^4.7", "facebook/webdriver": "^1.0" }, http://qiita.com/imunew/items/8806cd68a401c6975d44
・PHPUnit ・codecept ・Phantomjs
$url = 'http://'. self::BROWSERSTACK_USER. ':'. self::BROWSERSTACK_KEY. '@hub.browserstack.com/wd/hub'; return RemoteWebDriver::create($url, [
'browser' => "Chrome", 'browser_version' => "49.0", 'os' => "Windows", 'os_version' => "7", 'browserstack.debug' => "true", 'acceptSslCerts' => "true” ]); https://www.browserstack.com/automate/php
modules: enabled: - WebDriver: url: ‘https://hogehoge.com' browser: chrome - \Helper\Acceptance
Tips1 操作対象の項目にidを振って幸せになる
$I->fillField('//*[@id="main"]/div/div[2]/div/div[2]/div/input'); $textBox = $this->webDriver- >findElement(WebDriverBy::cssSelector('tbody input:nth- child(1)')); $textBox->sendKeys(’hogehoge'); idがないと、「cssセレクタをブラウザのコンソールで確認->貼付」の 繰り返しになり、時間がかかってテストコードを書くのが辛くなってく
る。 codeceptionのXPath指定はかなり便利。
Tips2 テストで確認する範囲を絞る
・複数の画面にまたがるテスト ・成功/失敗をいっぺんに確認するテスト は コード量・実行時間が増えて大変です。
Tips3 取得したスクリーショットを連結して 1枚にする
// about taking screenshots protected function concatFile($domain) { // saveScreenshot時に保存したファイルパスを取得
if(!empty($this->concatFiles)){ $now = new DateTime(); // 連結するベースになる画像の生成 $baseImg = imagecreatetruecolor(AbstractWebDriverTestCase::screenshotWidth, AbstractWebDriverTestCase::screenshotHeight*count($this- >concatFiles)); // ベースイメージにスクリーンショットを貼り付け for($i=0;$i<count($this->concatFiles);$i++){ $screenShot = imagecreatefrompng($this->concatFiles[$i]); imageCopy($baseImg, $screenShot, 0, AbstractWebDriverTestCase::screenshotHeight*$i, 0, 0, AbstractWebDriverTestCase::screenshotWidth, AbstractWebDriverTestCase::screenshotHeight); } // 連結した画像の保存 imagepng($baseImg, AbstractWebDriverTestCase::fileSavePath.$now->format('Ymd').'/'.$domain.'.png'); imagedestroy($baseImg); } // 個別のスクリーンショットは削除 for($i=0;$i<count($this->concatFiles);$i++){ if(file_exists($this->concatFiles[$i])){ unlink($this->concatFiles[$i]); } } // ループする時に前回実行時の情報が残ってしまうので、削除済みの情報を削除 $this->concatFiles = []; }
実行結果がvideoになって便利!
Tips4 あんなことやこんなことしたい
https://github.com/facebook/php-webdriver/issues http://codeception.com/docs/03-AcceptanceTests http://piccagliani.github.io/Codeception.docs.ja_JP/ index.html issuesに「こんなことしたいんだけど」->「こうすればできるよ」が豊富。 使い始めるとdocumentationより頻繁に見てる気がする。 日本語documentがあって安心。
)BWFBOJDF&&5FTU-JGF