Slide 1

Slide 1 text

XCUITestʹ͓͚Δঢ়ଶ ੍ޚʹ͍ͭͯߟ͑Δ

Slide 2

Slide 2 text

XCUITestͱ͸ XCTestʹؚ·ΕΔUI Testingͷ௨শ ςετର৅ͷΞϓϦʹର͠ɺϢʔβͱಉ౳ͷૢ࡞Λߦ͏UIςε τͷͨΊͷػೳ

Slide 3

Slide 3 text

ঢ়ଶʹ͍ͭͯ UIςετ͸ΑΓϢʔβʹ͍ۙܗͰςετର৅ΞϓϦΛϒϥοΫ ϘοΫεతʹૢ࡞͢ΔͨΊɺ ಺෦͔Βม਺΍ϝιουʹΞΫηε͠΍͍͢୯ମςετʹൺ΂ Δͱঢ়ଶΛ࡞Γʹ͍͘ͱݴ͑·͢ɻ

Slide 4

Slide 4 text

ঢ়ଶ੍ޚͷྫ(XCTest) XCUIApplicationͷlaunchArguments΍launchEnvironmentΛ ࢖ͬͯىಈ࣌ʹઃఆ஋Λ༩͑Δ let app = XCUIApplication() app.launchArguments.append("loggedIn") app.launchArguments.append(contentsOf: ["-key", "abc111222333"]) app.launchArguments.append(contentsOf: ["-skipLogin", "YES"]) app.launchEnvironment["TestMode"] = "UITest"

Slide 5

Slide 5 text

ঢ়ଶ੍ޚͷྫ(Target Application) ςετର৅ͷΞϓϦͰProcessInfoͷarguments,environment ͔Β஋ΛऔΓग़ͯ͠࢖༻͠·͢ɻ ProcessInfo.processInfo.arguments.contains("loggedIn") UserDefaults.standard.string(forKey: "key") UserDefaults.standard.bool(forKey: "skipLogin") ProcessInfo.processInfo.environment["TestMode"]

Slide 6

Slide 6 text

ىಈ࣌ʹҰׅͰ༩͑Δ͔͠ͳ͍

Slide 7

Slide 7 text

! ىಈޙʹ΍Εͳ͍ͩΖ ͏͔ʁ

Slide 8

Slide 8 text

ྫ͑͹͜Μͳ෩ʹ ౎౓ςετ͔Β஋ΛૹΓɺඞཁͳΒςετର৅͔Βड͚औΔ

Slide 9

Slide 9 text

݁࿦͔Β

Slide 10

Slide 10 text

ग़དྷ·ͨ͠

Slide 11

Slide 11 text

Darwin notifications

Slide 12

Slide 12 text

Darwin notificationsͱ͸ʁ CϕʔεͷAPIͰɺΞϓϦؒΛ·͍ͨͰ௨஌ΛૹΔ͜ͱ͕ՄೳͰ ͢ ! MMWormholeͳͲʹ΋࢖ΘΕ͓ͯΓɺWatch΍Extensionͷ։ ൃΛͨ͠ࣄ͕͋Δਓ͸ฉ͍ͨ͜ͱ͕͋Δ͔΋͠Ε·ͤΜɻ

Slide 13

Slide 13 text

! ྑͦ͞͏

Slide 14

Slide 14 text

Darwin notificationsͷΠϝʔδ

Slide 15

Slide 15 text

Darwin notificationsͷ੍ݶ ௨஌ͷΈΛૹΓ·͢ɻ NotificationͷΑ͏ʹuserInfoͳͲ͕͋Γ·ͤΜ σʔλΛ΍ΓऔΓ͢ΔͷͰ͋Ε͹Կ͔ผͷ࢓૊Έ͕ඞཁʹͳΓ ·͢ !

Slide 16

Slide 16 text

͋͞Ͳ͏͠Α͏ʁ

Slide 17

Slide 17 text

UIPasteboard

Slide 18

Slide 18 text

UIPasteboard ΞϓϦؒͷ৘ใ࿈ܞͱͯ͠ڞ௨Ͱѻ͑ΔϦιʔεͱͯ͠ݕ౼͠ ͨதͰ࢖͍উख͕ྑͦ͞͏ͳ΋ͷͱͯ͠UIPasteboardΛ࢖ͬͯ ΈΔ͜ͱʹ͠·ͨ͠ɻ

Slide 19

Slide 19 text

Telepathy

Slide 20

Slide 20 text

Telepathy (Ծ)

Slide 21

Slide 21 text

Sample Code(XCTest) let exp = XCTestExpectation(description: "normal") Telepathy.ask(with: "normal") { message in exp.fulfill() } wait(for: [exp], timeout: 5)

Slide 22

Slide 22 text

Sample Code(Target Application) Telepathy.listen { (message) in if message == "foo" { // something } Telepathy.answer() }

Slide 23

Slide 23 text

࣮ݱग़དྷ·ͨ͠Ͷʁ

Slide 24

Slide 24 text

ऴΘΓʹ Telepathy͸·ͩΞΠσΟΞݕূஈ֊Ͱະެ։ͷϥΠϒϥϦͰ ͢ɻ ࣮ફʹ͋ͨΓ༗ޮͳϢʔεέʔεͳͲΛ໛ࡧͯ͠Δ࠷தͳͷͰ͝ ҙݟ͍͚ͨͩΔͱ޾͍Ͱ͢ɻ

Slide 25

Slide 25 text

Ҏ্