
Accessibility Regression Testing With XCUI
The question often asked in the mobile development community is, "I want to be able to add accessibility to my regression tests, but is there a way to do it?". There have been many open source projects created in the past that have allowed for it, but most of them either have stopped having support or are out of date. Since Xcode 15, performAccessibilityAudit() is now a function that is readily available for use within XCUI tests! It runs the same automated checks as the "Accessibility Inspector" and allows for consistent regression of accessibility issues. So how do we make the most of it? Let's check it out! Setting it up The simple answer to setting it up is, if you have an XCTestCase using XCUIApplication() then you can call performAccessibilityAudit() on your content! final class accessibilityAuditExample : XCTestCase { var app : XCUIApplication ! override func setUpWithError () throws { continueAfterFailure = true app = XCUIApplication () app . launch () } It can be triggered on
Continue reading on Dev.to
Opens in a new tab


