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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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.7k
Make Work Visible in Agile2018 #LINE_DM
poohsunny
1
490
タウンワークをドライブさせるためになんちゃってアジャイルをやめた話 #devsumi #devsumiB / devsumi2018
poohsunny
30
47k
1 test 1 assert ?
poohsunny
0
510
XUTPから学ぶ記述性の高いユニットテスト 〜俺たちを助けるユニットテストへ〜 / xUTP in #xpjug
poohsunny
4
5.5k
コードに思いが伝わる
poohsunny
0
380
横浜タネマキでGebと握手! #yokohamagroovy
poohsunny
0
450
The "yummy" licenses.
poohsunny
0
260
ブラウザテストをサクサク自動化するためのGeb実践入門 #jjug_ccc
poohsunny
21
7.2k
Other Decks in Technology
See All in Technology
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
650
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
170
KPIだけでは評価できないプロダクトが考えるべき Evalsという第二の評価系 / Beyond KPIs: Evals as a Second Evaluation Framework for Products #PdEConf
aki_iinuma
4
3.9k
Where Is JetBrains AI Heading- — Central CLI, Air Alpha, and the Agentic Development Stack
x5gtrn
PRO
0
160
GoにおけるFFIのこれまでとこれから
goccy
5
2.5k
家のリアーキテクト・リファクタリング
suguruooki
0
120
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
0
110
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
110
安心して変更できるWebフロントエンドの作り方
pirosikick
4
1.4k
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
120
DEFCON_CHV_CTF_Write-up.pdf
bata_24
0
140
[2026-09-11]SREは誰のもの?運用エンジニアが始める 「SRE領域への越境」とチームの進化の軌跡 〜Road to NEXT CRE
tosite
0
160
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
520
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
420
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
560
The SEO Collaboration Effect
kristinabergwall1
1
550
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
First, design no harm
axbom
PRO
2
1.3k
The browser strikes back
jonoalderson
0
1.7k
Producing Creativity
orderedlist
PRO
348
41k
Making the Leap to Tech Lead
cromwellryan
135
10k
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ʙ