pub struct NodeQuery { /* private fields */ }Expand description
Declarative element query for AppRuntime::find_all, AppRuntime::click and friends.
When both text and title are set, an element must satisfy both. Only the deepest
matching elements are reported: an ancestor whose text merely aggregates a matching
descendant is not itself a match.
Implementations§
Source§impl NodeQuery
impl NodeQuery
Sourcepub fn text(text: impl Into<String>) -> Self
pub fn text(text: impl Into<String>) -> Self
Matches elements whose rendered text content equals text (see NodeQuery::contains).
Sourcepub fn title(title: impl Into<String>) -> Self
pub fn title(title: impl Into<String>) -> Self
Matches elements whose title attribute (or alt on <button> / <img>) equals title.
title and alt are not prioritised here, unlike the hover tooltip (which prefers
title): the element matches if either attribute matches the needle. A button with
title="Save" and alt="Store" is found by both "Save" and "Store". alt is only
considered on <button> and <img>; other elements match on title alone.
Sourcepub fn with_text(self, text: impl Into<String>) -> Self
pub fn with_text(self, text: impl Into<String>) -> Self
Additionally requires the element’s rendered text content to match.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Additionally requires the element’s title / alt to match.