Problems of Xcode UITesting

Xcode UITesing(EN)

Advantages

  1. Integrated UI Testing in Xcode means less work doing iOS automation than Appium because lots of steps could be automatically finished.
  2. Writing the test cases with OC or Swift feels cooloer, faster and more integrated.
  3. There is no doubt that Apple will continue upgrading this product, making it more powerful in the future.

Something Annoying with UITesting

  1. Need to judge whether a certain element is in the page especially when loading a hybrid page.
  2. Need to set object’s accessibilityIdentifier or accessibilityLabel(former recommended) if it cannot be automatically identified.
  3. 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

  1. Write some regular regression test cases to save time
  2. Improve the test coverage

Steps

  1. New a func named as ‘testXXXXXXX’ in a test case file and leave the cursor inside the method.
  2. Run
  3. Try record the case. Jump to Step 5 if the elements are identified. Otherwise, need to add identifiers manually.
  4. Perfect the code
  5. Test the case and see whether it could be passed.

Something Unresolved

  1. How to make the identifiers regularly?
  2. How to write the cases more quickly?

Tips

  1. Try to use Accessibility Inspector to identify some elements.
  2. Try to perfect utils provided by this branch:

Reference

https://testerhome.com/topics/3372

http://masilotti.com/ui-testing-xcode-7/

文章目录
  1. 1. Xcode UITesing(EN)
    1. 1.1. Advantages
    2. 1.2. Something Annoying with UITesting
    3. 1.3. What Can UITesting Help Jam
    4. 1.4. Steps
    5. 1.5. Something Unresolved
    6. 1.6. Tips
    7. 1.7. Reference
,