Problems of Xcode UITesting
- Integrated UI Testing in Xcode means less work doing iOS automation than Appium because lots of steps could be automatically finished.
- Writing the test cases with OC or Swift feels cooloer, faster and more integrated.
- There is no doubt that Apple will continue upgrading this product, making it more powerful in the future.
Something Annoying with UITesting
- Need to judge whether a certain element is in the page especially when loading a hybrid page.
- Need to set object’s accessibilityIdentifier or accessibilityLabel(former recommended) if it cannot be automatically identified.
- In Xcode 8.2.1, the test cases would not report the warnings and errors in build time, but it will fail the build.
What Can UITesting Help Jam
- Write some regular regression test cases to save time
- Improve the test coverage
- New a func named as ‘testXXXXXXX’ in a test case file and leave the cursor inside the method.
- Try record the case. Jump to Step 5 if the elements are identified. Otherwise, need to add identifiers manually.
- Perfect the code
- Test the case and see whether it could be passed.
- How to make the identifiers regularly?
- How to write the cases more quickly?
- Try to use Accessibility Inspector to identify some elements.
- Try to perfect utils provided by this branch: