Tagging Results

Link to Tagging Results copied to clipboard

Supported within:
axeDevTools UIKit framework axeDevTools XCUI framework

Tagging is a helpful feature to organize, share and search for scans within the axe DevTools Mobile Dashboard. Some helpful tags for your team may be the team name, build number, simulator version, etc.

Tagging is supported within manual or automated testing. Tagged scans are made available for other team members within your organization.

Send a Scan with a Tag

axeDevToolsUIKit Example

Manual Testing Unit Tests UI Tests

Manual Testing

Within the showA11yFAB method, you can pass in an array of tags you'd like added to any scan initiated by the floating action button.

try axe?.showA11yFAB(addTags: [String]?)

Unit Testing

Using the parameter withTags, we're attaching a tag named "build:0.0.1" to the scan.

func testAccessibility() throws {
    let viewFrame = CGRect(x: 0, y: 0, width: 200, height: 100)
    guard let result = try axe?.run(onView: UIView(frame: viewFrame)) else {
        XCTFail()
        return
    }
    
    try axe?.postResult(result, withTags: ["build: 0.0.1"])
}

UI Testing

Tag the result in the dashboard after initiating a scan by calling tagResult(key: AxeDevToolsResultKey, withTags: [String]).

Full Example:

    func testAccessibility() throws {
        let FAB_ID = "com.deque.axeDevTools.accessibilityFab"
        let fab = app.buttons[FAB_ID]

        // Tap the FAB to send the scan to the server
        fab.tap()

        // Once it returns, the result from the scan can be seen on the Dashboard.
        // The FAB's label has the key needed to retrieve the scan from the server.
        XCTAssert(fab.waitForExistence(timeout: 5))

        // Grab the result from the server
        guard let key = AxeDevToolsResultKey(fabTitle: fab.label) else {
            XCTFail("Could not retrieve scan from the server.")
            return
        }

        // Tag the result with the tags provided
        try axe?.tagResult(key, withTags: ["my tag"])

        let result = try axe?.getResult(key)

        // Fail the build if accessibility issues are found.
        XCTAssertEqual(result?.failures.count, 0)
    }

axeDevToolsXCUI Example

UI Tests

Using the parameter withTags, we're attaching a tag named "build:0.0.1" to the scan.

func testAccessibility() throws {
    guard let result = try axe?.run(onElement: XCUIApplication()) else {
        XCTFail()
        return
    }
    try axe?.postResult(result, withTags: ["build: 0.0.1"])
}