The document discusses iOS UI testing in Xcode. It provides an overview of record and playback, test scripts written in Swift or Objective-C, and running UI automation tests on iOS. It demonstrates recording a test and shows an example test for the "Add" button that launches the application, finds the button, taps it, and makes an assertion about the number of table cells. It also discusses code coverage and test reports.
1 of 18
Downloaded 18 times
More Related Content
iOS UI Testing in Xcode
1. iOS UI Testing in Xcode
Mark Chang
markchang@kkbox.com
Test Corner
2. About Me
? Mark Chang
? Testing Engineer in the KKBOX Inc.
? One of contributors in the ¡°Testing with KK¡± blog.
3. Overview
? Record and Playback
? Test script (Swift or Objective-C)
? Running UI automation testing in iOS
? Code coverage and test reports
7. Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
8. Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
9. Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
10. Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
11. Example
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Testing the Add button
12. Example
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Testing the Add button
13. Example
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Testing the Add button
14. Example
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)
Testing the Add button
15. Example
Testing the Add button
// application:
let app = XCUIApplication()
app.launch()
// element and query:
let addButton = app.buttons[¡°Add¡±]
addButton.tap()
// assertion:
XCTAssertEqual(app.tables.cells.count, 1)