Save Results Locally

Link to Save Results Locally copied to clipboard

Supported within:
axeDevTools UIKit framework axeDevTools XCUI framework

Save results locally to utilize the desktop client, or utilize the axe DevTools reporting tool to build an executive report off a set of scans within your CI/CD pipeline.

A scan's result will be saved as a .json file. Saving results locally is only supported within automated testing.

If the path and file name are not specified, the results will be named "(APPID)-(CURRENT_SCREEN_TITLE).json" and will be saved in a folder called "AxeDevToolsResults" within your User folder.

axeDevToolsUIKit Example

Unit Tests
func testHomeScreen() throws {
    let view = HomeViewController()
    guard let result = try axe?.run(onViewController: view) else { XCTFail(); return }

    //Save Result Locally
    let path = try axe?.saveResult(result)
    print("Result saved to location: \(path)")

    //Any assertions
    XCTAssertEqual(result.failures.count, 0)
}

axeDevToolsXCUI Example

UI Tests
func testAccessibility() throws {
    guard let result = try axe?.run(onElement: XCUIApplication()) else { XCTFail(); return }

    //Save Result Locally
    let path = try axe?.saveResult(result)
    print("Result saved to location: \(path)")

    //Any assertions
    XCTAssertEqual(result?.failures.count, 0)
}