(
udid: &str,
source: AccessibilitySource,
max_depth: Option<usize>,
include_hidden: bool,
interactive_only: bool,
server_url: &str,
)
| 5636 | } |
| 5637 | |
| 5638 | fn fetch_service_accessibility_tree( |
| 5639 | udid: &str, |
| 5640 | source: AccessibilitySource, |
| 5641 | max_depth: Option<usize>, |
| 5642 | include_hidden: bool, |
| 5643 | interactive_only: bool, |
| 5644 | server_url: &str, |
| 5645 | ) -> anyhow::Result<Value> { |
| 5646 | let mut query = vec![format!("source={}", source.as_query_value())]; |
| 5647 | if let Some(max_depth) = max_depth { |
| 5648 | query.push(format!("maxDepth={}", max_depth.min(80))); |
| 5649 | } |
| 5650 | if include_hidden { |
| 5651 | query.push("includeHidden=true".to_owned()); |
| 5652 | } |
| 5653 | if interactive_only { |
| 5654 | query.push("interactiveOnly=true".to_owned()); |
| 5655 | } |
| 5656 | let path = format!( |
| 5657 | "/api/simulators/{}/accessibility-tree?{}", |
| 5658 | url_path_component(udid), |
| 5659 | query.join("&") |
| 5660 | ); |
| 5661 | http_get_json(server_url, &path) |
| 5662 | } |
| 5663 | |
| 5664 | fn fetch_service_accessibility_point( |
| 5665 | udid: &str, |
no test coverage detected