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
How to control state in UI Test
Search
Shingo Tamaki
February 20, 2019
Technology
4
2.5k
How to control state in UI Test
I considered what how to controll state in UI Test interactively.
This is summary of my idea.
Shingo Tamaki
February 20, 2019
Tweet
Share
More Decks by Shingo Tamaki
See All by Shingo Tamaki
沖縄モバイルアプリ開発勉強会#1
tamaki
0
71
iOSアプリ開発を始めよう
tamaki
0
98
詳解xcresult.pdf
tamaki
0
270
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
tamaki
0
650
What do you want to test with UI Test v2
tamaki
2
820
JPQRによって変わる日本のQRコード決済
tamaki
0
230
What's New in Testing
tamaki
1
58
What do you want to test with UI Test
tamaki
5
1.7k
Asynchronous Testing in XCTest
tamaki
0
360
Other Decks in Technology
See All in Technology
Oracle Database Backup Service:サービス概要のご紹介
oracle4engineer
PRO
0
4k
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
39k
PlaywrightによるE2Eテスト入門 / Introduction to E2E Testing with Playwright
rhumie
3
1k
リクルート新人研修2024 テキスト生成AI活用
recruitengineers
PRO
10
470
四国クラウドお遍路 2024 in 高知 エンディング
yukataoka
0
150
Staff Engineer / 20240827 Yuichiro Masui
shift_evolve
0
190
【Λ(らむだ)最近のアプデ情報 / RPALT20240904
lambda
0
170
突撃! 隣のAmazon Bedrockユーザー 〜YouはどうしてAWSで?〜
minorun365
PRO
2
180
自社サービスのための独自リリース版Redmine「RedMica」の取り組み
vividtone
0
780
ロボットアームを遠隔制御の話 & LLMをつかったIoTの話もしたい
soracom
PRO
1
210
waitany と waitall を作った話
mrkn
0
110
セキュリティ監視の内製化 効率とリスク
mixi_engineers
PRO
7
820
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
128
8.8k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
27
7.4k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
88
16k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
32k
Unsuck your backbone
ammeep
667
57k
Designing for humans not robots
tammielis
248
25k
Building an army of robots
kneath
302
42k
Become a Pro
speakerdeck
PRO
22
4.9k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
Large-scale JavaScript Application Architecture
addyosmani
508
110k
Transcript
XCUITestʹ͓͚Δঢ়ଶ ੍ޚʹ͍ͭͯߟ͑Δ
XCUITestͱ XCTestʹؚ·ΕΔUI Testingͷ௨শ ςετରͷΞϓϦʹର͠ɺϢʔβͱಉͷૢ࡞Λߦ͏UIςε τͷͨΊͷػೳ
ঢ়ଶʹ͍ͭͯ UIςετΑΓϢʔβʹ͍ۙܗͰςετରΞϓϦΛϒϥοΫ ϘοΫεతʹૢ࡞͢ΔͨΊɺ ෦͔ΒมϝιουʹΞΫηε͍͢͠୯ମςετʹൺ Δͱঢ়ଶΛ࡞Γʹ͍͘ͱݴ͑·͢ɻ
ঢ়ଶ੍ޚͷྫ(XCTest) XCUIApplicationͷlaunchArgumentslaunchEnvironmentΛ ͬͯىಈ࣌ʹઃఆΛ༩͑Δ let app = XCUIApplication() app.launchArguments.append("loggedIn") app.launchArguments.append(contentsOf: ["-key",
"abc111222333"]) app.launchArguments.append(contentsOf: ["-skipLogin", "YES"]) app.launchEnvironment["TestMode"] = "UITest"
ঢ়ଶ੍ޚͷྫ(Target Application) ςετରͷΞϓϦͰProcessInfoͷarguments,environment ͔ΒΛऔΓग़ͯ͠༻͠·͢ɻ ProcessInfo.processInfo.arguments.contains("loggedIn") UserDefaults.standard.string(forKey: "key") UserDefaults.standard.bool(forKey: "skipLogin") ProcessInfo.processInfo.environment["TestMode"]
ىಈ࣌ʹҰׅͰ༩͑Δ͔͠ͳ͍
! ىಈޙʹΕͳ͍ͩΖ ͏͔ʁ
ྫ͑͜Μͳ෩ʹ ςετ͔ΒΛૹΓɺඞཁͳΒςετର͔Βड͚औΔ
͔݁Β
ग़དྷ·ͨ͠
Darwin notifications
Darwin notificationsͱʁ CϕʔεͷAPIͰɺΞϓϦؒΛ·͍ͨͰ௨ΛૹΔ͜ͱ͕ՄೳͰ ͢ ! MMWormholeͳͲʹΘΕ͓ͯΓɺWatchExtensionͷ։ ൃΛͨ͠ࣄ͕͋Δਓฉ͍ͨ͜ͱ͕͋Δ͔͠Ε·ͤΜɻ
! ྑͦ͞͏
Darwin notificationsͷΠϝʔδ
Darwin notificationsͷ੍ݶ ௨ͷΈΛૹΓ·͢ɻ NotificationͷΑ͏ʹuserInfoͳͲ͕͋Γ·ͤΜ σʔλΛΓऔΓ͢ΔͷͰ͋ΕԿ͔ผͷΈ͕ඞཁʹͳΓ ·͢ !
͋͞Ͳ͏͠Α͏ʁ
UIPasteboard
UIPasteboard ΞϓϦؒͷใ࿈ܞͱͯ͠ڞ௨Ͱѻ͑ΔϦιʔεͱͯ͠ݕ౼͠ ͨதͰ͍উख͕ྑͦ͞͏ͳͷͱͯ͠UIPasteboardΛͬͯ ΈΔ͜ͱʹ͠·ͨ͠ɻ
Telepathy
Telepathy (Ծ)
Sample Code(XCTest) let exp = XCTestExpectation(description: "normal") Telepathy.ask(with: "normal") {
message in exp.fulfill() } wait(for: [exp], timeout: 5)
Sample Code(Target Application) Telepathy.listen { (message) in if message ==
"foo" { // something } Telepathy.answer() }
࣮ݱग़དྷ·ͨ͠Ͷʁ
ऴΘΓʹ Telepathy·ͩΞΠσΟΞݕূஈ֊Ͱະެ։ͷϥΠϒϥϦͰ ͢ɻ ࣮ફʹ͋ͨΓ༗ޮͳϢʔεέʔεͳͲΛࡧͯ͠Δ࠷தͳͷͰ͝ ҙݟ͍͚ͨͩΔͱ͍Ͱ͢ɻ
Ҏ্