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
XCUITestする時のTIPs 〜あなたを助けるXCUITestへ〜
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
PoohSunny
May 22, 2017
Technology
3.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
XCUITestする時のTIPs 〜あなたを助けるXCUITestへ〜
iOS Test Night #4
https://testnight.connpass.com/event/54316/
での発表資料です。
PoohSunny
May 22, 2017
More Decks by PoohSunny
See All by PoohSunny
ドレイファスモデルの紹介 / introduce Dreyfus model
poohsunny
1
1.8k
Make Work Visible in Agile2018 #LINE_DM
poohsunny
1
510
タウンワークをドライブさせるためになんちゃってアジャイルをやめた話 #devsumi #devsumiB / devsumi2018
poohsunny
30
47k
1 test 1 assert ?
poohsunny
0
520
XUTPから学ぶ記述性の高いユニットテスト 〜俺たちを助けるユニットテストへ〜 / xUTP in #xpjug
poohsunny
4
5.5k
コードに思いが伝わる
poohsunny
0
380
横浜タネマキでGebと握手! #yokohamagroovy
poohsunny
0
460
The "yummy" licenses.
poohsunny
0
260
ブラウザテストをサクサク自動化するためのGeb実践入門 #jjug_ccc
poohsunny
21
7.2k
Other Decks in Technology
See All in Technology
子育てエンジニアの可処分時間が減っても成長を諦めない戦い方
sudoakiy
6
4.5k
自分で立ててみるLLMサービス
y_sera15
0
160
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
7
5.9k
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
420
ai_cording_with_k8s_knowledge.pdf
mochizuki875
1
350
しろおびから始める!ログ活用の第一歩
shumei_ito
0
920
契約書画像からの情報抽出に特化した視覚接地モデルを育てる話
sansantech
PRO
1
180
Essential architectural thinking (revised edition)
ufried
0
120
12 個 Tool と、 4,096 Token
hlum
0
150
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
880
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
0
120
FactoryBotアンチパターン / factory_bot anti-patterns
toshimaru
0
160
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
470
Amusing Abliteration
ianozsvald
1
340
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Between Models and Reality
mayunak
4
490
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
We Have a Design System, Now What?
morganepeng
55
8.4k
We Are The Robots
honzajavorek
0
400
Transcript
XCUITest͢Δ࣌ͷ TIPs ʙ͋ͳͨΛॿ͚ΔXCUITestʙ @PoohSunny iOS Test Night #4
@PoohSunny { work: "σΟϕϩούʔ", company: "ϦΫϧʔτδϣϒζ", lang: ["Swift", "Java", "Groovy"],
community: [ "TDDBC", "Agile Samurai Base Camp", "ຊSeleniumϢʔβʔίϛϡχςΟ" ] }
Selenium͖1 1 ग़ॴɿٕज़ධࣾ
iOSॳΊͯ̍ ʢποίϛܴʂʣ
ΑΖ͘͠ ͓ئ͍͠·͢
UITestͷ
None
XCUITest ͍ͬͯ·͢
TIPsͷհ ଞͷςετϑϨʔϜϫʔΫͰ͑Δͣʂ
TIP1 Ͳ͜·Ͱςετ͢Ε͍͍Μ ͩorz
εϞʔΫςετ
1. جຊతͳಈઢ 2. མͪΔͱॏେো ʹͳΔ෦
TIP2 UIΛมߋͨ͠Βͨ͘͞Μͷς ετ͕͚ͯ͜͠·ͬͨorz
ϖʔδΦϒδΣΫτύλʔϯ Λར༻ͨ͠มߋͷہॴԽ ςετରͷϖʔδΛΦϒδΣΫτͱͯ͠ςετ ͔ΒΓ͠ɺϝϯςφϯεੑΛߴΊΔ2 2 http://www.seleniumhq.org/docs/06testdesign_considerations.jsp#page-object-design-pattern
ཁ3 • publicϝιου->ϖʔδ͕ఏڙ͢ΔαʔϏεΛ දݱ • ϖʔδͷ෦Λ࿐ग़͠ͳ͍Α͏ʹ͠·͢ • ҰൠతʹɺΞαʔγϣϯߦ͍·ͤΜ • ϝιουผͷPageObjectsΛฦ͠·͢
3 http://garbagetown.hatenablog.com/entry/2013/11/07/075011͔ΒҾ༻
σΟϨΫτϦ UITest |-- Module // ֤ϖʔδͰڞ௨͢Δ෦܈ |-- Screen // ϖʔδΦϒδΣΫτ
`-- Test // ࣮ࡍͷςετέʔε
αϯϓϧ class TopScreen: BaseScreen { required init(xcuiApplication: XCUIApplication) { super.init(xcuiApplication:
xcuiApplication) XCTAssert(app.navigationBars["τοϓ"].exists) } func ݕࡧϘλϯΛԡ͢() -> BaseScreen { app.navigationBars.buttons.elementBoundByIndex(0).tap() return ResultScreen(xcuiApplication: xcuiApplication) } }
TIP3 ͜ͷςετԿͯ͠Δͷ͔Θ͔ ΜͶʔorz
ςετͷՄಡੑΛ্͛Δ ྫ͑ར༻ϝιου໊Λຊޠʹ͢Δ func testۈΛબ͢Δ() { let τοϓϖʔδ = TopScreen(xcuiApplication: XCUIApplication())
τοϓϖʔδ.ಓݝΛબ͢Δ(Area.౦ژ) let ݕࡧ݁Ռϖʔδ = τοϓϖʔδ.ݕࡧ͢Δ() XCTAssert(ݕࡧ݁Ռϖʔδ.දࣔ͞Ε͍ͯΔ()) }
ϖʔδΦϒδΣΫτΛ ࡞ΓࠐΉ func testۈΛબ͢Δ() { let τοϓϖʔδ = TopScreen(xcuiApplication: XCUIApplication())
let ݕࡧ݁Ռϖʔδ = τοϓϖʔδ.Լه݅Ͱݕࡧ͢Δ(Area.౦ژ, "ϑϦʔϫʔυ") XCTAssert(ݕࡧ݁Ռϖʔδ.දࣔ͞Ε͍ͯΔ()) }
Given-When-Thenҙࣝͯ͠ ΈΔ func testۈΛબ͢Δ() { // given let τοϓϖʔδ =
TopScreen(xcuiApplication: XCUIApplication()) // when let ݕࡧ݁Ռϖʔδ = τοϓϖʔδ.Լه݅Ͱݕࡧ͢Δ(Area.౦ژ, "ϑϦʔϫʔυ") // then XCTAssert(ݕࡧ݁Ռϖʔδ.දࣔ͞Ε͍ͯΔ()) }
4 phase test4Ͱ Setup - Exercise - Verify - Teardown
3A5Ͱ Arrange - Act - Assert 5 http://xp123.com/articles/3a-arrange-act-assert/ 4 http://xunitpatterns.com/Four%20Phase%20Test.html
·ͱΊ • TIP1. Ͳ͜·Ͱςετ͢Δ͔໎ͬͨΒεϞʔΫ ςετ • TIP2. มߋΛہॴԽ͍ͨ͠ͳΒϖʔδΦϒδΣ Ϋτύλʔϯ •
TIP3. ՄಡੑΛ্͍͛ͨͳΒຊޠΛ͏ͷΛ ԀΘͳ͍
͓͠·͍ ʙ͋ͳͨΛॿ͚ΔXCUITestʙ