SlackTextViewController
SlackTextViewController copied to clipboard
Add UI Tests
Since this library consists, mainly, of custom UI elements, a great way to test it is by using Snapshot Test Case: it takes a configured UIView
or CALayer
and uses the renderInContext:
method to get an image snapshot of its contents. It compares this snapshot to a reference image stored in the source code repository and fails the test if the two images don't match. Differences are visible by using tools like Kaleidoscope.
Areas to look at:
- [x] TextView growing mechanism and guarantee its positioning on top of the keyboard
- [x] Display of text input outlets
- [ ] Auto-correction & edit modes
- [ ] Auto-Correction & Predictive Bar states
- [ ] Undo/Redo & Copy/Cut/Paste custom mechanisms
- [ ] Multiple screen sizes support (iPhone 4, 5, 6, 6+ and iPad)
- [ ] Multiple orientations support (landscape & portrait)
- [ ] External keyboard support (very important once, which also requieres logic tests)
- More TBD
Tools:
To Install:
- [x] Install
Expecta+Snapshots
, which provides an Expecta-like API toFBSnapshotTestCase
.
pod 'Expecta+Snapshots', '~> 1.0'
- [x] Install XCode plugin Snapshots (via Alcatraz) to easily compare the success and failure images for any inline failed test in Xcode.
Process
- To be able to cover most iOS fragmentations, we are going to run test for multiple devices, OS and orientations.
Reading Material:
- http://www.objc.io/issue-15/snapshot-testing.html