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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Classes/GlobalStateExplorers/FLEXWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@ - (void)viewDidLoad {
self.webView.frame = self.view.bounds;
self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

// Set accessibility identifiers for automated testing
if ([self.title containsString:@"Request"]) {
self.webView.accessibilityIdentifier = @"network_request_body";
self.webView.accessibilityLabel = @"Request Body";
if (self.originalText.length > 0) {
self.webView.accessibilityValue = self.originalText;
}
} else if ([self.title containsString:@"Response"]) {
self.webView.accessibilityIdentifier = @"network_response_body";
self.webView.accessibilityLabel = @"Response Body";
if (self.originalText.length > 0) {
self.webView.accessibilityValue = self.originalText;
}
} else {
// Generic body content
self.webView.accessibilityIdentifier = @"network_body_content";
self.webView.accessibilityLabel = @"Network Body Content";
if (self.originalText.length > 0) {
self.webView.accessibilityValue = self.originalText;
}
}

if (self.originalText.length > 0) {
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithTitle:@"Copy" style:UIBarButtonItemStylePlain target:self action:@selector(copyButtonTapped:)
Expand Down
3 changes: 3 additions & 0 deletions Classes/Network/FLEXNetworkMITMViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.backgroundColor = FLEXColor.primaryBackgroundColor;
}

// Add accessibility identifier for automated testing
cell.accessibilityIdentifier = [NSString stringWithFormat:@"network_call_%ld", (long)indexPath.row];

return cell;
}

Expand Down