MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / batch_expectation_json

Function batch_expectation_json

packages/server/src/main/batch.rs:625–661  ·  view source on GitHub ↗
(args: &StepOptions)

Source from the content-addressed store, hash-verified

623}
624
625fn batch_expectation_json(args: &StepOptions) -> Option<Value> {
626 let has_expectation = args.value("expect-id").is_some()
627 || args.value("expect-label").is_some()
628 || args.value("expect-value").is_some()
629 || args.value("expect-element-type").is_some()
630 || args.value("expect-type").is_some()
631 || args.value("expect-index").is_some();
632 has_expectation.then(|| {
633 serde_json::json!({
634 "selector": {
635 "id": args.value("expect-id"),
636 "label": args.value("expect-label"),
637 "value": args.value("expect-value"),
638 "elementType": args
639 .value("expect-element-type")
640 .or_else(|| args.value("expect-type")),
641 "index": args
642 .value("expect-index")
643 .and_then(|value| value.parse::<usize>().ok()),
644 },
645 "source": "native-ax",
646 "maxDepth": args
647 .value("expect-max-depth")
648 .and_then(|value| value.parse::<usize>().ok())
649 .unwrap_or(8),
650 "includeHidden": args.flag("expect-include-hidden"),
651 "timeoutMs": args
652 .value("expect-timeout-ms")
653 .and_then(|value| value.parse::<u64>().ok())
654 .unwrap_or(5_000),
655 "pollMs": args
656 .value("poll-interval-ms")
657 .and_then(|value| value.parse::<u64>().ok())
658 .unwrap_or(100),
659 })
660 })
661}
662
663fn batch_selector_from_args(args: &StepOptions) -> ElementSelector {
664 ElementSelector {

Callers 1

batch_line_to_json_stepFunction · 0.85

Calls 1

valueMethod · 0.80

Tested by

no test coverage detected