Tutorial by Examples

When creating the project You should check "Include UI Tests" in the project creation dialog. After creating the project If you missed checking UI target while creating project, you could always add test target later. Setps: While project open go to File -> New -> Target Fi...
When Accessibility enabled in Utilities Select storyboard. Expand the Utilities Select Identity Inspector Select your element on storyboard Add new Accessibility Identifier (in example addButton) When Accessibility disabled in Utilities Select storyboard. Expand the Utilities Select...
In a test you can disable animations by adding in setUp: app.launchEnvironment = ["animations": "0"] Where app is instance of XCUIApplication.
Lunch application for testing override func setUp() { super.setUp() let app = XCUIApplication() app.launch() } Terminating application func testStacOverFlowApp() { app.terminate() }
Device can be rotate by changing orientation in XCUIDevice.shared().orientation: XCUIDevice.shared().orientation = .landscapeLeft XCUIDevice.shared().orientation = .portrait

Page 1 of 1