Challenge Overview
The Retail 360 iOS App is a tool used by Hercules employees in their retail stores. The app allows for looking up customer details and will eventually contain lots of functionality for managing customer accounts, making changes to their accounts, and adding notes, sending emails, etc...
We have released version 1 of the app to some employees, and version 2 is nearing completion. As we add more and more functionality, we need to ensure that the existing functionality isn't broken by any new changes.
This challenge will expand the UI unit tests for the app, which we will build on over the next couple of months to get proper coverage of the app.
Requirements:
This challenge will expand the unit tests that exist to cover the manage devices for profiles. Only the develop target is in scope
Coverage:
Proper coverage is required, of positive and negative test cases. The reviewers should ensure that the coverage report can be run and that the coverage % is appropriate for the functionality tested.
Any existing tests that fail are out of scope.
Required tests:
Note: All tests require a login and lookup. Login and account lookup is already covered by other tests, so we can just make sure that the scripted test logs in and can get to the "Profile" tab with a loaded customer
You can get to "Manage Devices" by loading a profile for an account and clicking the "Manage Devices" button. It may take awhile because the dev build is slow.
There are two main functions that are involved in "Manage Devices" so far:
1. Removing an inactive device (not in scope)
2. Swapping a device
To remove a device:
1. Go to "Manage Devices"
2. Click the checkbox next to an inactive device and click "remove selected"
3. Click "Continue to Confirmation"
4. Agree to the terms, and then sign with your finger
5. Click "confirm"
6. On the last screen, you can email a receipt to yourself (possibly) and print. You won't be able to print because you don't have a receipt printer, so we can just kind of mention that vaguely. I can always attach a picture of a receipt from my receipt printer.
To swap a device:
1. Go to Manage Devices
2. Click "Add Device Manually"
3. Enter a serial number
4. Click "Add" on the add device popup
5. You'll see the new device in the list with an "Add" indicator. You can cancel the add by clicking "Cancel"
6. Next, remove a device of the same type (set top box for set top box, etc...)
7. Once you have a remove and an add, click "Continue to Confirmation"
8. Agree to the terms, and then sign with your finger
9. Click "confirm"
10. On the last screen, you can email a receipt to yourself (possibly) and print. You won't be able to print because you don't have a receipt printer, so we can just kind of mention that vaguely. I can always attach a picture of a receipt from my receipt printer.
There are a few "gates" to swapping a device, and we'll need unit tests for these.
1. The device added can't already be assigned to a user
2. The device added can't be inactive
3. A swap is only valid for like devices (Set top box to Set top box), so it won't work if you try to swap a voice modem for a set top box, as an example
4. Only inactive devices can be removed. If you attempt to remove an active device on the first screen and then click "Continue to Confirmation", it should throw up an error at you.
Test data
Here is some test data that can be used (please do NOT edit this file)
https://docs.google.com/spreadsheets/d/1dhYfXLNsNGsrvf3_01kNVgJhYvGtrRLnyUpDiXG8eY4/edit#gid=0
Note that your tests should be able to be run in any state of a given test account, according to the data above. So, if you're doing a swap on an account, your test should be able to handle either the original *or* swapped device registered on the account, just so we don't have to do all sorts of resetting before the unit test run.
Not in scope
Currently, we don't have a reliable way of getting inactive devices, so we can leave out anything that requires that, like testing the removal flow and testing adding a disabled device.
Helpful links:
* https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/09-ui_testing.html
* https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/07-code_coverage.html
* http://cleanswifter.com/measuring-swift-code-coverage/
* https://developer.apple.com/videos/play/wwdc2015/410/
* http://mgrebenets.github.io/mobile%20ci/2015/09/21/code-coverage-for-ios-xcode-7
Submission format
Your submission should be provided as a Git patch file against the commit hash mentioned in the forum. MAKE SURE TO TEST YOUR PATCH FILE!
Your submission should be provided as a Git patch file against the commit hash mentioned in the forum. MAKE SURE TO TEST YOUR PATCH FILE!
No video is required for this challenge.
A separate UNIT_TESTS_README.md exists in Git. It should be updated for this challenge.