How to start learning XCUITest from scratch

Suparna Khamaru
2 min readFeb 8, 2022

--

I have been contacted by interested beginners a few times requesting on how to start learning and getting started with XCUITest/XCTest. It could be quite challenging for a beginner to dig into all important & must-know concepts while getting started in the initial stages of learning.

I have jotted down few of the resources below, that I have found handy while I had started with XCTest/XCUITest.

Without much delay, let us learn and cover all the must-know concepts for excelling in end to end XCUITest journey.

1.1. Swift

Video Courses:

  1. https://www.udemy.com/course/swift-programming/must-do
  2. https://www.udemy.com/course/swift-for-intermediate-and-advanced-ios-developers/optional & can be covered later post initial explorations

Articles:

  1. https://www.hackingwithswift.com/articles/126/whats-new-in-swift-5-0
  2. https://www.raywenderlich.com/55728-what-s-new-in-swift-5
  3. https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html
  4. https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html

1.2. XCUITest

Video courses:

  1. https://testautomationu.applitools.com/introduction-to-ios-test-automation-with-xcuitest/
  2. https://www.linkedin.com/learning/automated-testing-in-xcode/welcome?u=2711649
  3. https://www.udemy.com/course/ios-native-xcuitest-uitest-automation-using-swift-xcode/
  4. https://www.youtube.com/results?search_query=xcuitest+eugene
  5. https://developer.apple.com/videos/play/wwdc2019/413/

Articles:

  1. https://digital.ai/catalyst-blog/how-to-get-started-with-xcuitest-ios
  2. https://blog.novoda.com/getting-started-with-xcuitest-framework-for-testing-ios-apps/
  3. https://super-tester.medium.com/ios-how-to-automate-tests-for-apps-without-having-access-to-development-source-code-a35824abd5e3
  4. https://betterprogramming.pub/how-to-reverse-engineer-an-ios-app-313a95950aff
  5. https://medium.com/zendesk-engineering/ui-testing-ios-apps-with-the-robot-pattern-dd839b59fed1

1.3. XCode

1.4. Github Sample Test Frameworks

Some of my sample projects on XCUITests are here:

  1. https://github.com/suparna-khamaru/ios-test-app/tree/master/TestAppUITests
  2. https://github.com/suparna-khamaru/swift-demo-app/tree/master/brightcosmeticsUITests
  3. https://github.com/suparna-khamaru/Twitter-UI-Test-Automation-XCUITest

2. Before Kick-starting project exploring:

What we follow while designing a test framework:

  1. Protocol oriented framework
  2. Page object design pattern
  3. Clean code
  4. DRY principle
  5. ACI integration
  6. Usage of SOLID practices
  7. Red Green Refactor Pattern

What we do not follow:

  • Follow the AAA — Arrange, Act, Assert principle, but in page object method and NOT on test method itself (Reason: These are not Unit tests, but usually are either Functional tests or Integration tests or System tests)

Note:

XCUITest framework primarily follows the principles and practices of testing pyramid and hence, these are usually either medium or large size tests as documented below:

  1. https://developer.apple.com/documentation/xcode/testing-your-apps-in-xcode
  2. https://developer.android.com/training/testing/fundamentals
  3. https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html

--

--

Suparna Khamaru
Suparna Khamaru

Written by Suparna Khamaru

I am passionate about iOS, Android, Web apps,API test, Automation & ACI— https://www.linkedin.com/in/suparnakhamaru/

Responses (1)