seleniumconf16 uk参加報告
TRANSCRIPT
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
SeleniumConf’16 UK参加報告
技術本部 システム研究開発センター
石川 真也
2016/12/18
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
自己紹介
2
石川 真也(@meganetaaan)
新日鉄住金ソリューションズ(入社3年目)
システム研究開発センター所属
「Webのちからで業務アプリを作る」
Seleniumベースのテストライブラリ「Pitalium」開発中
– 私がSeleniumを使ってスクリーンショットを撮るまでに出会った闇のすべて
子育てエンジニア(3年目)
息子(2歳)
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
今日の内容
3
概要
SeleniumConf’16 UK 基本情報
開催地・会場の雰囲気
参加目的
セッション紹介
セッション概要
セッション分類
(分類ごとに)おもしろかったセッション紹介
こぼれ話(時間があれば)
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
概要
4
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
SeleniumConf’16 UK 基本情報
5
Selenium Conf ‘16 UK
日程:
11/14 9:00-17:00 ワークショップ
11/15-16 9:00-17:00 セッション
会場:
The Mermaid Conference & Event Centre London, UK
参加者:
300名程度
– テストエンジニア
– 品質保証担当者
Webサイト:
http://2016.seleniumconf.co.uk/
セッションの動画を全編公開中
地図データ©2016 Google
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
開催地:London, UK
6
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
開催地:Mermaid theatre, London, UK
7
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
開催地:Mermaid theatre, London, UK
8
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
開催地:Mermaid theatre, London, UK
9
Jonathan Lipps(AppiumのProject Lead)
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
開催地:Mermaid theatre, London, UK
10
Pitaliumを紹介しました
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
セッション紹介
11
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
セッション概要
12
全30セッション
キーノート
通常セッション
クロージングパネル
– Seleniumコミッターによる討論
2トラック
分類は無く、様々な話題がまぜこぜ
キーノート
トラック1 トラック2
キーノート
Day1
11/14
メイン会場 サブ会場
キーノート
トラック1 トラック2
パネル
Day2
11/15
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
セッション(勝手に)分類
13
Tech技術的トピック
Biz業務で使うために
まず始めてみた話
課題を解決した話
こんなこともできる!TIPS
Selenium/Appium最新情報セッション
Seleniumコミッターによる最新情報やロードマップの
解説
UIテスト以外の使い方Seleniumハック
一からSeleniumを始めてみた時の体験談
開発や運用保守における課題を解決した話
AA
BB
CC
DD
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Selenium/Appium最新情報A14
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
A Selenium/Appium最新情報
15
Selenium3.0について
W3CのWebDriver仕様と各ブラウザベンダーの動向
Appium js.foundationへの移管
StarDriver構想
Selenium IDEの今後
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Selenium3.0について
16
2016/10/13リリース
「(一昨年の今頃)クリスマスまでに出すって言いましたけど」
「確かにクリスマスまでに出したよね!」
古いAPI(Selenium Core)を削除
「W3C標準仕様としての」WebDriverAPIに準拠していく
StarDriver Enterprise Appium to the Future
www.youtube.com/watch?v=e61OhZzbsEI
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
W3CのWebDriver仕様
17
SeleniumはW3CのWebDriver仕様に準拠する
https://www.w3.org/TR/webdriver/
ブラウザベンダ自身がWebDriver仕様に沿ったドライバを開発する
ブラウザの更新への追従はドライバ開発者(≒ベンダ自身)が行う
Seleniumとドライバのリリースサイクルを切り分けられる
Selenium
Chrome
Driver
Firefox
Driver
Internet
Exlorer
Driver
Chrome
Firefox
Internet
Explorer
W3C
WebDriver
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Appium:js.foundationへの移管
18
js.foundation:Linux財団傘下の非営利団体
jQuery, ESLint, Mocha, webpack等
Sause Labは今後も積極的にコミットすると表明
Appiumの継続性を担保するひとつの材料
StarDriver Enterprise Appium to the Future
www.youtube.com/watch?v=e61OhZzbsEI
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Appium:StarDriver構想
19
「WebDriverProtocolを介してあらゆるデバイスを自動化する」
IoTデバイスのテストも可能になるかも
*Driver→StarDriver
StarDriver Enterprise Appium to the Future
www.youtube.com/watch?v=e61OhZzbsEI
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
StarDriver Enterprise Appium to the Future
20
Appium JSONWP
Server
UiAutomator
UiAutomator2
WinAppDriver
XCUITest
Selendroid
Instruments/
UIAutomation
Youi.tv
appium
Appium JSONWP
Server
UiAutomator
UiAutomator2
WinAppDriver
XCUITest
Selendroid
Instruments/
UIAutomation
Youi.tv
appium
XXDriver
YYDriver
StarDriver Enterprise Appium to the Future
www.youtube.com/watch?v=e61OhZzbsEI
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Selenium IDEの今後
21
Selenium IDEが無くなるかもしれない件
Committers Panelでの一幕
「Selenium IDEは今後どうなりますか?」の質問に対し
「今年中に最後のリリースをする予定」
さらにコミッターはSelenium IDEの開発に消極的なもよう
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Committers Panel
22
各コミッターの発言要旨
年内に最後のリリースをする
– (IDEに対応した)古いFirefoxを使いつつ、移行を検討してほしい
テスト自動化の間口を広げるためにIDEは貢献している
– 特に、日本でのシェア・ニーズは把握している
しかし、我々はコードが書きたくて開発をしている
IDEが良いと思うなら輪に加わって、議論して!
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
こんなこともできる!TIPSB23
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
B こんなこともできる!TIPS
24
Robots: The Nuclear Option Selenium経由でロボットを動かしてスマホを操作させる
Let's Talk Security - Beyond Scanning セキュリティテスト
Measuring Web Performance Using Selenium パフォーマンス測定
The State of Browser Automation with JavaScript 動画や音声のテスト
スクレイピング
Chrome Driver Jailbreak(Lightning Talkより)
ドライバとブラウザの間にプロキシを噛ませてWebDriver単体でできないこと(開発者ツール操作等)をする
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Robots: The Nuclear Option
25
Robots The Nuclear Option
https://www.youtube.com/watch?v=hyIMGy38E4s
なぜロボット? 手動テストの柔軟性 自動化の信頼性
ユースケース アプリの操作中に電話の着信があって中断、開き直す 端末の電源ON→アプリ実行 ユーザのスワイプジェスチャでアプリを起動
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Robots: The Nuclear Option
26
Robots The Nuclear Option
https://www.youtube.com/watch?v=hyIMGy38E4s
購入はこちら:
https://www.tindie.com/products/hugs/tapster/
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
まず始めてみた話C27
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
C まず始めてみた話
28
CIは大前提
自動化をどう始めるか?のHowTo 自動化の文化を根付かせる組織論
自分の境遇に近い人のセッションが参考になりそう 小規模/大規模?
既にあるマニュアルテストを自動化/最初から自動化?
Building a Test Engineering Culture テスト自動化の文化を根付かせるための組織論
Refactoring for Testability: Breaking the Cycle of Doom アジャイルの現場で自動化テストを始めるためのHowTo
How to Get Automation Included in Your Definition of Done アジャイルのスプリント内に自動化のプロセスを「完了」させるための取り組み
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
課題を解決した話D29
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
D 課題を解決した話
30
大規模・長期間テストを回す上での課題の解決
不安定な(flaky)テストを無くしたい…
スクリプトの保守性を上げたい…
テスト実行が遅い…
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
不安定な(flaky)テストを無くしたい
31
flaky test: 同じコードで成功/失敗どちらにもなるテスト
https://testing.googleblog.com/2016/05/flaky-tests-at-google-and-
how-we.html
原因は様々
ネットワーク
複数ブラウザが協調するテスト
アプリケーション側のnon-deterministicなバグ
解決へのアプローチ
環境毎の成功・失敗の統計を取って不安定なテストを突き止める
– Big Data Makes the Flake Go Away
– Test trend analysis: Towards robust, reliable and timely tests
テスト自動化のインフラを改善する
– Reliability Patterns for Large-scale Selenium Tests
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Big Data Makes the Flake Go Away
32
Big Data Makes the Flake Go Away
www.youtube.com/watch?v=oRIci6n566w
テスト毎のリトライ数の統計「リトライしたら成功してしまった」→flaky!
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
スクリプトの保守性を上げたい
33
スクリプトを読みやすく、保守しやすくするための工夫
The Screenplay Pattern - a SOLID alternative to Page
Objects PageObjectの改良版「Screenplay Pattern」の紹介
Selenium tests, the Object Oriented way アサーションを画面内のコンポーネント毎にまとめる工夫
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Screenplay Pattern
34
PageObject PatternはSOLID原則に反している
単一責任原則(Single Responsibility Principle)
– ページの要素を特定する
– ページの要素を介してタスクを実行する
開放/閉鎖原則(Open Closed Principle)
– タスクを増やす度にPageObjectを変更する必要がある
– タスクの追加に対して開いていない
The Screenplay Pattern - a SOLID alternative to Page Objects
www.youtube.com/watch?v=8f8tdZBvAbI
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
Screenplay Pattern
35
Modelling the problem not the solution
@RunWith(SerenityRunner.class)public class AddNewTodos {
Actor james = Actor.named("James");
@Managedprivate WebDriver hisBrowser;
@Before public void jamesCanBrowseTheWeb() {james.can(BrowseTheWeb.with(hisBrowser));
}
@Testpublic void should_be_able_to_add_a_todo_item() {
givenThat(james).wasAbleTo(Start.withAnEmptyTodoList());when(james).attemptsTo(AddATodoItem.called("Buy some milk"));then(james).should(seeThat(TheItems.displayed(), hasItem("Buy some milk")));
}}
@RunWith(SerenityRunner.class)public class AddNewTodos {
Actor james = Actor.named("James");
@Managedprivate WebDriver hisBrowser;
@Before public void jamesCanBrowseTheWeb() {james.can(BrowseTheWeb.with(hisBrowser));
}
@Testpublic void should_be_able_to_add_a_todo_item() {
givenThat(james).wasAbleTo(Start.withAnEmptyTodoList());when(james).attemptsTo(AddATodoItem.called("Buy some milk"));then(james).should(seeThat(TheItems.displayed(), hasItem("Buy some milk")));
}}
https://www.infoq.com/articles/Beyond-Page-Objects-Test-Automation-Serenity-Screenplay
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
まとめ
36
Seleniumの最新動向を把握できた
テスト自動化の事例、ソリューションを収集できた
セッションの録画を見返したい
キャプション(英語)も付いている
参加者やコミッターとの交流ができた
Web経由ではできない体験!
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
終わりに
37
Selenium IDEの今後について考えたい!
Selenium Confで発表したい! 次回はテキサス州オースティンで開催(2017/4/3~5)
セッション:募集中(~2017/1/17)
LT:現地で募集。誰でも参加可能。
プレゼンスを上げていけばいずれはSeleniumConf@Tokyoも…!
意見交換しましょう!
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
聴講したセッション一覧
38
Zen and the Art of Open Source Maintenance
Reliability Patterns for Large-scale Selenium Tests
Making Cross-Browser Tests Beautiful
Distributed Testing and Test Reporting
Advanced Appium
Building a Test Engineering Culture
The Screenplay Pattern
Think inside Container
Robots: The Nuclear Option
A Programmer's Guide to Humans
Turning iOS End-to-End Testing up to 11
Selenium tests, the Object Oriented way
Is it or is it not really visible... Selenium's flawed vision
Test trend analysis: Towards robust, reliable and timely tests
Measuring Web Performance Using Selenium
Refactoring for Testability: Breaking th Cycle of Doom
Committers panel
Copyright ©2016 NS Solutions Corporation. All Rights Reserved.
商標について
39
NS Solutions、NS(ロゴ)は、新日鉄住金ソリューションズ株式会社の登録商標です。
hifive、hifive(ロゴ)、Pitalium、Pitalium(ロゴ)は、新日鉄住金ソリューションズ株式会社の登録商標です。
Internet Explorerは、米国 Microsoft Corporation の米国およびその他の国における登録商標です。
その他本文記載の会社名及び製品名は、それぞれ各社の商標又は登録商標です。