2. What we’ll be going over
Introduction
Best tools for UI testing iOS applications
Introduction into the framework
Demo of UI automation
CI/CD
3. Konnor Willison @konnorwillison
Worked at Bluehost, Overstock, Vivint.
Currently at Demandware/Salesforce as a Software Developer in Test
We’re hiring!
Quality Assurance Engineer II
Data Engineer Team Lead
Sr. Infrastructure Engineer
Principal Engineer-Platform Operations Training
Senior Java Developer
Work mostly in Java
Love anything automation
Was tasked with finding a solution to automate iOS UI testing
4. What are some ways to UI test iOS
applications?
KIF – Keep it Functional
Calabash
Appium
Apple’s UIAutomation (currently dropped)
Xcode 7+ UI Testing
5. Testing with Xcode
UI Testing
Interact with UI Elements
Verify UI properties and states
UI Recording
Rapidly set up projects
Uses XCTest and Accessibility
7. Requirements
iOS 9+
OS X 10.11+
iOS devices need to be enabled for development
Connected to trusted host running Xcode
OS X must grant permission to Xcode Helper
8. Main APIs to Interact with
XCUIApplication
XCUIElement
XCUIElementQuery
11. XCUIElement
proxy object for user interface elements
types (buttons, cells, window)
identifiers from accessibility, label, title (how to find element, combine
type and identify)
for hierarchy in application
elements must be unique (resolve to single instance)
exception (exists property)
where simulation of UI exists
12. XCUIElementQuery
specify elements
only get accessible elements
number of matches using count
elementAtIndex
filter by type, label
Find element by subscripting – table.staticTexts[“Order Now”]
Index – table.staticTexts.elementAtIndex(0)
Unique – app.navigationBars.element
Evaluated on demand
13. Recording
Add reliability with minimal effort
Use recording to find the elements
Event validation with XCTAssert
KIF: integration framework, directly in xcode project, written in objective c
Calabash: uses cucumber, screenshots, able to test in the cloud, not integrated with xcode
Appium: uses webdriver protocol
Apple’s uiautomation: javascript
Xcode UI testing: integrated with xcode, recording, can use xcodebuild, screenshots, quickstart
Xctest is xcode’s testing framework
test methods
assertions
integrated with xcode
debugging easy
continuous integration
supports swift and obj c
Accessibility
how disabled people can interact with iOS
semantic data for guiding through the UI
provides apis to fine tune data that is present
this way can interact with environment the same way the user does
improve accessibility data, impacts testing, easier to write tests, more reliable, better for disabled users
not accessible: custom view subclasses, layers, sprites, and other graphics
Don’t go over these
Three new apis
XCUIApplication()
proxy for tested application
independent of app
XCUIElement()
proxy object for user interface elements
types (buttons, cells, window)
identifiers from accessibility, label, title (how to find element, combine type and identify)
for heirarchy in application
elements must be unique (resolve to single instance)
exception (exists property)
where simulation of UI exists
XCUIElementQuery()
specify elements
only get accessible elements
number of matches using count
elementAtIndex
filter by type, label