feat(automation): resolve_unique + wait-state evaluation

This commit is contained in:
SoftFever
2026-06-03 01:42:38 +08:00
parent ddd1967bff
commit e449a0b618
3 changed files with 41 additions and 0 deletions

View File

@@ -45,6 +45,12 @@ std::vector<const UiNode*> find_matches(const UiNode& root, const Target& target
return out;
}
const UiNode* resolve_unique(const UiNode& root, const Target& target, int& match_count) {
const auto m = find_matches(root, target);
match_count = static_cast<int>(m.size());
return m.size() == 1 ? m.front() : nullptr;
}
bool evaluate_state(const UiNode* node, WaitState state,
const std::optional<std::string>& expected_value) {
if (node == nullptr)