Save Results Locally

Link to Save Results Locally copied to clipboard

Save results locally to utilize the axe DevTools Reporter CLI 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.

Optional Parameters

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. Scan name will default to the title of the view controller if available. try axe?.saveResult(result, toPath: "", withFileName: "", withScanName: "")

Full Example

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)