Upload
mobile-delivery-days
View
215
Download
4
Embed Size (px)
Citation preview
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
References
1. https://github.com/wikimedia/wikipedia-ios2. Tech Talk: Nothing Left but Always Right: The Twisted Road to RTL Support3. rtl.wtf4. https://github.com/facebook/ios-snapshot-test-case5. fastlane6. Testing Your Internationalized App7. https://github.com/Quick/Quick
Further Reading
1. A look at iOS 9’s comprehensive support for right-to-left languages (9to5mac.com)
2. Supporting Right-to-Left Languages3. objc.io article about Snapshot Testing