Fashionable Test Automation for iOS Apps with XCUITest

Apple is investing heavily on testing tools and techniques. They introduced Swift programming language in 2014 and launched Xcode UI Testing framework in 2015. Since then Swift is becoming first class citizen for writing iOS apps. Apple also launched Xcode UI testing framework a.k.a XCUITest to test those apps written in Swift. XCUITest is extension of XCTest framework which is Apple’s unit, network and performance testing framework. Using XCUITest, we can write UI Tests in Swift and put the UI Test code in the same repository as application code which makes collaboration with developers and CI/CD practices much smoother. The traditional tools like Appium and Calabash doesn’t fits well in the native app development with Swift. Although, XCUITest has recorder to get started with UI testing, we need to use some patterns to make XCUITest more scalable. Unlike the Page Object Pattern Or Screenplay Pattern in the web testing, we need to organise XCUITests using some sort of test design pattern to make them scalable.Swift is designed to be a protocol oriented programming language and it has some awesome features like protocols, extensions, enumerations. The patterns like Page Objects or Screenplay may work somehow but they doesn’t fit in the protocol oriented way of Swift. We can use protocol oriented approach to architect XCUITests that can be scaled easily within iOS CI/CD pipelines. In this talk, we will cover following things
1] Current iOS Test Automation Tooling and it’s limitations
2] Getting Started with Swift and XCUITests
3] Swift Protocol Oriented Approach for the XCUITest
4]XCUITest at YNAP
5] Tips for writing CI friendly XCUITests. e.g Stubs, Accessibility Identifiers, Real Device Tests, Xcode scheme strategy for UI Tests etc