Apple announced the Xcode UI Testing framework in WWDC 2015 that allows us to write user interface tests for iOS apps using Swift or Objective-C. The only option remained to automate iOS apps is the XCUITest framework. Since iOS 10, there is a growing trend of iOS teams adopting XCUITest and deprecating old toolbox. Let’s start with what Xcode UI testing is.
Xcode UI Testing
Xcode UI Testing is also known as XCUITest that is a huge expansion of the testing technology in the Apple platform apps like iOS. With UI testing we can simulate user actions in the simulators or devices to find out if our application is working with the latest changes in the code. With XCUITest, we can interact with the UI element and validate its position or state in our apps.
XCUITest framework allows us to write UI tests straight inside the Xcode with the separate UI testing target in the app. We can use Apple’s own programming languages e.g. Swift or Objective-C for writing UI Tests in the Xcode. XCUITest runs in the separate process from our main iOS app and it doesn’t have to access application’s internal methods, API or data. XCUITest uses Accessibility technology to interact with the main iOS app, which means application developers need to provide accessibility information for UI elements to make apps accessible as well as testable.
Agenda for XCUITest 101
From this week, we will explore steps to get started with XCUITest to automate iOS app testing with the latest Xcode 10. Below you can find a brief agenda for each topic and make sure you follow us every week.
- Setting Up XCUITest Framework for iOS App Testing in Xcode 10
- Writing DRY XCUITest Tests With Base Classes
- BDD for XCUITest with Swift Protocols and Extensions
- Best Practices for Organizing Locators for XCUITest
- Scaling XCUITest for iOS Devices with Different Screen Sizes
- How To Use XCUITest API
- Setting up XCUITest for iOS Continuous Integration
- Setting up XCUITest on Bitbar’s Device Testing Cloud
We hope you will take away some insights from these tips & tricks and best practices. Stay tuned for the first blog!