AI Briefing
KO

How Banksalad's iOS Team Writes Test Code Like Breathing, Part 2 - Screen-Level Integration Tests

·2022.04.27 09:00

Key point

Banksalad's iOS team automated design QA and accessibility verification using snapshot tests and AXSnapshot.

Details

Banksalad's iOS development team shared how they verify discrepancies between design mockups and actual implementation, and automate accessibility features, through screen-level integration tests. They shortened the previous process of checking after a full app build down to seconds-long test execution, speeding up development.

Automating Design QA with Snapshot Tests

Developers use Snapshot tests as a development tool rather than for CI. They inject data directly into views to verify specific scenarios, and manage the generated screenshots as XCTAttachment. These screenshots are extracted via xcparse and shared on Slack, then finalized as the definitive reference image after review by designers and PMs. This process resolves test failures caused by pixel-level discrepancies, and induces the test code to fail first when a design is modified, supporting a workflow similar to TDD.

Verifying Accessibility with AXSnapshot

To compensate for the limitations of image-based testing, they introduced AXSnapshot. This tool converts a View's Accessibility properties into a text array to verify what VoiceOver will read. It prevents missing connections between ViewModel and View, and ensures the intended experience for accessibility feature users. AXSnapshot serves as documentation for tests and helps overcome the limitations of manual testing. The tool is open-sourced, and external contributions are welcome.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.