Slide 1

Slide 1 text

Xcode & fastlane iOS iOS meetup Nagoya

Slide 2

Slide 2 text

@temoki Fenrir Inc. / PL, iOS Engineer Mobile Act NAGOYA /

Slide 3

Slide 3 text

VanApp Fenrir Van = Fenrir

Slide 4

Slide 4 text

Fenrir VanApp iOS https://van­app.com/dokidokiglass

Slide 5

Slide 5 text

Swift (2015 ) Objective­C Swift4 iPhone X

Slide 6

Slide 6 text

1. UI 2. UI Accessibility Identifier 3. UI 4.

Slide 7

Slide 7 text

UI Xcode 7 UI Test Unit Test UI Test

Slide 8

Slide 8 text

Accessibility Identifier UI Storyboard Accessibility Identifier

Slide 9

Slide 9 text

class UITestsForScreenshot: XCTestCase { override func setUp() { super.setUp() } override func tearDown() { super.tearDown() } func testForScreenshot() { // UI }

Slide 10

Slide 10 text

// let app = XCUIApplication() app.launch() // UI Accessibility Identifier let glassButton = app.buttons["glass-button"].firstMatch let sensorButton = app.buttons["sensor-button"].firstMatch // glassButton.tap() sensorButton.tap()

Slide 11

Slide 11 text

// // let tap3Button = app.buttons["tap3_button"].firstMatch expectation(for: NSPredicate(format: "exists == true"), evaluatedWith: tap3Button, handler: nil) waitForExpectations(timeout: 30, handler: nil) // 10 for _ in 1...10 { tap3Button.tap() }

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

UI UI // let screenshot = XCUIScreen.main.screenshot() // let attachment = XCTAttachment(screenshot: screenshot) attachment.lifetime = .keepAlways add(attachment)

Slide 14

Slide 14 text

Report Navigator

Slide 15

Slide 15 text

(1)

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

fastlane snapshot fastlane iOS/Android snapshot https://github.com/fastlane/fastlane

Slide 18

Slide 18 text

( ) 1. UI 2. UI Accessibility Identifier 3. UI 4. fastlane snapshot 5. UI Snapshot 6. fastlane snapshot

Slide 19

Slide 19 text

fastlane snapshot RubyGems fastlane Xcode snapshot Snapfile, SnapshotHelper.swift $ sudo gem install fastlane --verbose $ fastlane snapshot init Snapfile # devices(["iPhone 8","iPhone 8 Plus","iPhone X","iPhone SE"]) # languages(["ja-jP"])

Slide 20

Slide 20 text

snapshot SnapshotHelper.swift UI let app = XCUIApplication() // snapshot setupSnapshot(app) // ) snapshot("01_Connection ")

Slide 21

Slide 21 text

(2)

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

UI UI app.launchArguments.append("SCREENSHOT") ProcessInfo ProcessInfo.processInfo.arguments.contains("SCREENSHOT") UI

Slide 24

Slide 24 text

UI ( )

Slide 25

Slide 25 text

UIViewController view Accessibility Identifier otherElements view // .otherElements view let view = app.otherElements["connection-view"].firstMatch // view expectation(for: NSPredicate(format: "exists == true"), evaluatedWith: element, handler: nil) waitForExpectations(timeout: 30, handler: nil)

Slide 26

Slide 26 text

$ fastlane snapshot ( + snapshot )

Slide 27

Slide 27 text

fastlane frameit (iPhone Plus) ( X )