Skip to content

chore: adds network history accessibility ids #722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jazz-mobility
Copy link

🎯 Add Accessibility Identifiers for Network History Automation Testing

Why (Problem/Motivation)

  • Test Automation Support: Enable automated API validation testing by providing unique, programmatic access to network history UI elements
  • Accessibility Gap: Network call list items and request/response body views lacked proper accessibility identifiers for automation scripts
  • Developer Productivity: Improve debugging workflow efficiency by making network inspection programmatically accessible

What (Changes Made)

  • ✅ Added unique accessibility identifiers to network call table cells (network_call_{index})
  • ✅ Added accessibility identifiers for request/response body web views (network_request_body, network_response_body)
  • ✅ Implemented proper accessibility labels and values for better semantic meaning
  • ✅ Ensured fallback identifier for generic network body content (network_body_content)

How (Implementation Details)

Network Call List Items

File: Classes/Network/FLEXNetworkMITMViewController.m

  • Modified tableView:cellForRowAtIndexPath: to assign unique identifiers
  • Pattern: network_call_0, network_call_1, etc.
  • Uses row index for guaranteed uniqueness within the visible list

Request/Response Body Views

File: Classes/GlobalStateExplorers/FLEXWebViewController.m

  • Enhanced viewDidLoad with title-based identifier assignment
  • Content moved from identifier to accessibilityValue for proper semantic structure
  • Supports both request and response body differentiation

Technical Approach

  • Minimal Impact: Uses only conventional UIKit accessibility properties
  • No Dependencies: No additional frameworks or complex observers required
  • Standard Patterns: Follows iOS accessibility best practices
  • Backward Compatible: Changes don't affect existing functionality

Testing

Automation scripts can now:

// Select specific network calls
app.cells["network_call_0"].tap()

// Access request/response content
let requestBody = app.webViews["network_request_body"]
let content = requestBody.value as? String

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant