UITest with XCTest

Link to UITest with XCTest copied to clipboard
Free Trial

Below is a full example of getting started with XCUITests:

import axeDevToolsXCUI
import XCTest

class AccessiblityXCUITest: XCTestCase {

    var axe: AxeDevTools?
    let app = XCUIApplication()

    override func setUpWithError() throws {
        continueAfterFailure = false
        axe = try AxeDevTools.login(withUsername: "<DEQUE_USERNAME>", andPassword: "<DEQUE_PASSWORD>")

        app.launch()        
    }

    func testMainScreen() throws {
        let result = try axe?.run(onElement: app)
        
        //Fail the build if accessibility issues are found.
        XCTAssertEqual(result?.failures.count, 0)
    }
}