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
82
iOSアプリ開発を始めよう
tamaki
0
120
詳解xcresult.pdf
tamaki
0
300
メルペイでのリグレッションテスト自動化推進のこれまでとこれから
tamaki
0
680
What do you want to test with UI Test v2
tamaki
2
840
JPQRによって変わる日本のQRコード決済
tamaki
0
240
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
370
Other Decks in Technology
See All in Technology
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
690
Application Development WG Intro at AppDeveloperCon
salaboy
0
190
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
540
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
Flutterによる 効率的なAndroid・iOS・Webアプリケーション開発の事例
recruitengineers
PRO
0
120
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
420
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
Lexical Analysis
shigashiyama
1
150
強いチームと開発生産性
onk
PRO
35
11k
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.7k
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
190
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
BBQ
matthewcrist
85
9.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Designing Experiences People Love
moore
138
23k
A better future with KSS
kneath
238
17k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
RailsConf 2023
tenderlove
29
900
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
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·ͩΞΠσΟΞݕূஈ֊Ͱະެ։ͷϥΠϒϥϦͰ ͢ɻ ࣮ફʹ͋ͨΓ༗ޮͳϢʔεέʔεͳͲΛࡧͯ͠Δ࠷தͳͷͰ͝ ҙݟ͍͚ͨͩΔͱ͍Ͱ͢ɻ
Ҏ্