Visual & Logical tests for an international iOS app

Post on 14-Apr-2017

215 views 4 download

transcript

Visual & logical tests for an international iOS appA case study of the Wikipedia iOS app[1]

Mobile Delivery Days, Day 2 (March 22, 2016)Brian Gerstle (@b_gerstle) lookback.io

● RTL (right-to-left)○ Hebrew (he)○ Arabic (ar)

● LTR (left-to-right)○ English (en)○ German (de)○ French (fr)

What does RTL mean?

?Why is it important

● Drastically improves UX for users that prefer RTLlanguages

●Makes your app more inclusive

For more information, check out Moriel Schottlender’s RTL talk[2] and rtl.wtf[3] website.

LTR & RTL Wikipedia article previews

Looks easy, almost too easy...

It would be, except:

● Visual tests?!○ Visual test framework: FBSnapshotTestCase[4]

● Immutable global state?!○ Runtime configuration with launch arguments[5]

● Multiple test runs?!○ fastlane[6]

Visual testing in a nutshell

2. Compare with reference image

1. Snapshot a view

Pass or Fail?

Let’s write a visual test!

Automate it with fastlane!

But, we need LTR and RTL visual tests!

Add Xcode launch arguments!

Pass!

Automate both schemes with fastlane!

Visually test all the things!

What about navigation?

Gallery architecture

Picture of the Day Model

Article Gallery Model

Modal Article Header Model

Modal gallery Article header galleryGallery Model Protocol

Testing RTL support across multiple OS versions

● Ideally, write simple UI test to verify swipe navigation behavior in all cases

● Unit test the business logic in the gallery model

iOS 8 iOS 9

LTR 0...N 0...N

RTL N...0 0...N

Quick[7] shared behaviors (BDD)

Running tests on iOS 8 & 9

Running all the tests in parallel

Next steps

● Functional tests● Automating test runs on device● Adding another dimension to the visual matrix: device model (i.e. iPhone 6,

iPhone 4S, iPad, etc.)● Compile once, run tests in parallel

Thanks!Any questions?

Brian Gerstle (@b_gerstle) lookback.io