Slide 1

Slide 1 text

BETTER APPSTORE RATING

Slide 2

Slide 2 text

ABOUT > Khoa Pham > https://onmyway133.github.io/

Slide 3

Slide 3 text

AGENDA > AppStore rating > Automate screenshot > Advertisements

Slide 4

Slide 4 text

RATING AND REVIEW

Slide 5

Slide 5 text

RATING AND REVIEW > Rate 1 to 5 stars > Optionally write a review > Specific to each country on the App Store > Can reset summary rating when submit new version release > Past written reviews remain

Slide 6

Slide 6 text

ASK import StoreKit SKStoreReviewController.requestReview()

Slide 7

Slide 7 text

TRACK USER REVIEW? > Use provided dialog > Can request max 3 times a year > Out of process, not available to view debugging or other inspections

Slide 8

Slide 8 text

TIPS > Respond to reviews > Prioritize reviews > Choose when to ask > Link to AppStore review page > A/B testing

Slide 9

Slide 9 text

RESPOND TO REVIEWS

Slide 10

Slide 10 text

DEMO RATING > Feature toggling > Dependency injection > Conditions > Periodic > Unit Testing

Slide 11

Slide 11 text

SPEK https://github.com/onmyway133/Spek BDD function builder testing framework in Swift

Slide 12

Slide 12 text

SPEK import XCTest @testable import Spek final class SpekTests: XCTestCase { func testExample() { var left = 1 var right = 1 spec { Describe("math") { BeforeEach { left = 2 } Describe("basic") { BeforeEach { right = 3 } AfterEach { } It("adds correctly") { XCTAssertEqual(left + right, 5) } It("multiplies correctly") { XCTAssertEqual(left * right, 6) } } } } } }

Slide 13

Slide 13 text

AUTOMATE SCREENSHOTS

Slide 14

Slide 14 text

SCENARIOS n languages * m screen sizes

Slide 15

Slide 15 text

XCATTACHMENT func takeScreenshot(_ name: String) { let screenshot = XCUIScreen.main.screenshot() let attachment = XCTAttachment(screenshot: screenshot) attachment.lifetime = .keepAlways attachment.name = name add(attachment) }

Slide 16

Slide 16 text

UITESTS SCHEME > Run and Test actions > Application data > Routing App Coverage File > Application language > Application region

Slide 17

Slide 17 text

LAUNCH ARGUMENTS final class ScreenshotUITests: XCTestCase { var app: XCUIApplication! override func setUp() { continueAfterFailure = false app = XCUIApplication() app.launchArguments.append("--uitesting") app.launch() } }

Slide 18

Slide 18 text

XCRESULT Xcode 11 release notes The format of result bundles changed in Xcode 11. A result bundle is an asset produced by Xcode 11 with the xcresult file extension that contains information about the build, tests, code coverage, and more

Slide 19

Slide 19 text

XCRESULTTOOL xcresulttool get --format json --path ./Example.xcresult

Slide 20

Slide 20 text

TESTING IN XCODE 11 WWDC 2019 Testing in Xcode > Test plan > Gather screenshots for localization

Slide 21

Slide 21 text

DEMO UITESTS > XCTContext > Swizzle > Parallel on multiple simulators

Slide 22

Slide 22 text

PUMA https://github.com/pumaswift/Puma

Slide 23

Slide 23 text

PUMA SCREENSHOT TASK Screenshot { $0.configure( projectType: .project("TestApp"), appScheme: "TestApp", uiTestScheme: "TestAppUITests", saveDirectory: Directory.downloads.appendingPathComponent("PumaScreenshots").path ) $0.add(scenarios: [ .init( destination: .init( name: Destination.Name.iPhone11, platform: Destination.Platform.iOSSimulator, os: Destination.OS.iOS13_2_2 ), language: Language.en_US, locale: Locale.en_US ), .init( destination: .init( name: Destination.Name.iPhone11Pro, platform: Destination.Platform.iOSSimulator, os: Destination.OS.iOS13_2_2 ), language: Language.ja, locale: Locale.ja ) ]) }

Slide 24

Slide 24 text

BUILD TOOL WITH PUMA swift package init --type executable swift package generate-xcodeproj swift build swift run

Slide 25

Slide 25 text

READ MORE > Ratings, Reviews, and Responses

Slide 26

Slide 26 text

THANKS May your code continue to compile