Save Results Locally
Supported within:
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
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
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)
}