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.6k
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
88
iOSアプリ開発を始めよう
tamaki
0
130
詳解xcresult.pdf
tamaki
0
310
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
tamaki
0
690
What do you want to test with UI Test v2
tamaki
2
850
JPQRによって変わる日本のQRコード決済
tamaki
0
250
What's New in Testing
tamaki
1
58
What do you want to test with UI Test
tamaki
5
1.8k
Asynchronous Testing in XCTest
tamaki
0
380
Other Decks in Technology
See All in Technology
生成AIのガバナンスの全体像と現実解
fnifni
1
190
Qiita埋め込み用スライド
naoki_0531
0
5.1k
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
480
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
740
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
第3回Snowflake女子会_LT登壇資料(合成データ)_Taro_CCCMK
tarotaro0129
0
190
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
530
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
32k
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
ハイテク休憩
sat
PRO
2
150
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Code Review Best Practice
trishagee
65
17k
GitHub's CSS Performance
jonrohan
1030
460k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
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·ͩΞΠσΟΞݕূஈ֊Ͱະެ։ͷϥΠϒϥϦͰ ͢ɻ ࣮ફʹ͋ͨΓ༗ޮͳϢʔεέʔεͳͲΛࡧͯ͠Δ࠷தͳͷͰ͝ ҙݟ͍͚ͨͩΔͱ͍Ͱ͢ɻ
Ҏ্