How to start learning XCUITest from scratch
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:
- https://www.udemy.com/course/swift-programming/ → must-do
- https://www.udemy.com/course/swift-for-intermediate-and-advanced-ios-developers/ → optional & can be covered later post initial explorations
Articles:
- https://www.hackingwithswift.com/articles/126/whats-new-in-swift-5-0
- https://www.raywenderlich.com/55728-what-s-new-in-swift-5
- https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html
- https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html
1.2. XCUITest
Video courses:
- https://testautomationu.applitools.com/introduction-to-ios-test-automation-with-xcuitest/
- https://www.linkedin.com/learning/automated-testing-in-xcode/welcome?u=2711649
- https://www.udemy.com/course/ios-native-xcuitest-uitest-automation-using-swift-xcode/
- https://www.youtube.com/results?search_query=xcuitest+eugene
- https://developer.apple.com/videos/play/wwdc2019/413/
Articles:
- https://digital.ai/catalyst-blog/how-to-get-started-with-xcuitest-ios
- https://blog.novoda.com/getting-started-with-xcuitest-framework-for-testing-ios-apps/
- https://super-tester.medium.com/ios-how-to-automate-tests-for-apps-without-having-access-to-development-source-code-a35824abd5e3
- https://betterprogramming.pub/how-to-reverse-engineer-an-ios-app-313a95950aff
- 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:
- https://github.com/suparna-khamaru/ios-test-app/tree/master/TestAppUITests
- https://github.com/suparna-khamaru/swift-demo-app/tree/master/brightcosmeticsUITests
- https://github.com/suparna-khamaru/Twitter-UI-Test-Automation-XCUITest
2. Before Kick-starting project exploring:
What we follow while designing a test framework:
- Protocol oriented framework
- Page object design pattern
- Clean code
- DRY principle
- ACI integration
- Usage of SOLID practices
- 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: