diff --git a/Classes/GlobalStateExplorers/FLEXWebViewController.m b/Classes/GlobalStateExplorers/FLEXWebViewController.m index 7680c4620..5b3628fa3 100644 --- a/Classes/GlobalStateExplorers/FLEXWebViewController.m +++ b/Classes/GlobalStateExplorers/FLEXWebViewController.m @@ -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:) diff --git a/Classes/Network/FLEXNetworkMITMViewController.m b/Classes/Network/FLEXNetworkMITMViewController.m index 54314b879..c4b644e02 100644 --- a/Classes/Network/FLEXNetworkMITMViewController.m +++ b/Classes/Network/FLEXNetworkMITMViewController.m @@ -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; }