XCTest

  • XCTestCase subclass which creates and store XCUIApplication object for duration of the test.

    Example:

    class AdditionalExtensionsTests: AppUITestCase {
        override func setUp() {
            super.setUp()
            TestLauncher.configure(app).launch()
        }
    }
    

    Remark

    Every call to XCUIApplication creates new instance of this object. This is why the XCUIApplication object is created at the beginning of the test and stored in the app variable.
    See more

    Declaration

    Swift

    open class AppUITestCase: XCTestCase
  • Declaration

    Swift

    class XCUIElement : NSObject, XCUIElementAttributes, XCUIElementTypeQueryProvider
  • Replacement for XCUICoordinate which works in portrait and landscape orientations.

    XCUICoordinate has an open issue. Coordinates works correctly only in portrait orientation. This workaround was implemented based on glebon gist.

    Example:

    let element = app.tableViews.element
    element.smartCoordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
    
    SmartXCUICoordinate(referencedElement: element, normalizedOffset: CGVector(dx: 0.5, dy: 0.5)).tap()
    

    Note

    rdar://31529903 XCUICoordinate tap() or press(forDuration:) methods work only in portrait orientation.

    Remark

    This functionality was implemented based on glebon gist.
    See more

    Declaration

    Swift

    open class SmartXCUICoordinate