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
ハイテク休憩
sat
PRO
2
140
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
20241220_S3 tablesの使い方を検証してみた
handy
3
320
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
380
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
300
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
220
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
210
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
440
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Become a Pro
speakerdeck
PRO
26
5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Scaling GitHub
holman
458
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Code Reviewing Like a Champion
maltzj
520
39k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Building an army of robots
kneath
302
44k
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·ͩΞΠσΟΞݕূஈ֊Ͱະެ։ͷϥΠϒϥϦͰ ͢ɻ ࣮ફʹ͋ͨΓ༗ޮͳϢʔεέʔεͳͲΛࡧͯ͠Δ࠷தͳͷͰ͝ ҙݟ͍͚ͨͩΔͱ͍Ͱ͢ɻ
Ҏ্