pub enum Selector {
Css(String),
XPath(String),
Text(String),
TestId(String),
Entity(String),
CssWithText {
css: String,
text: String,
},
CanvasEntity {
entity: String,
},
Role {
role: String,
name: Option<String>,
},
Label(String),
Placeholder(String),
AltText(String),
}Expand description
Selector type for locating elements
Variants§
Css(String)
CSS selector (e.g., “button.primary”)
XPath(String)
XPath selector
Text(String)
Text content selector
TestId(String)
Test ID selector (data-testid attribute)
Entity(String)
WASM entity selector (game-specific)
CssWithText
Combined selector with text filter
CanvasEntity
Canvas entity selector (game objects)
Role
ARIA role selector (e.g., “button”, “textbox”, “link”)
Label(String)
Label selector (form elements by associated label text)
Placeholder(String)
Placeholder selector (input/textarea by placeholder attribute)
AltText(String)
Alt text selector (images by alt attribute)
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn role(role: impl Into<String>) -> Self
pub fn role(role: impl Into<String>) -> Self
Create a role selector (ARIA role matching)
Per Playwright: page.getByRole('button', { name: 'Submit' })
Sourcepub fn role_with_name(role: impl Into<String>, name: impl Into<String>) -> Self
pub fn role_with_name(role: impl Into<String>, name: impl Into<String>) -> Self
Create a role selector with name filter
Sourcepub fn label(text: impl Into<String>) -> Self
pub fn label(text: impl Into<String>) -> Self
Create a label selector (form elements by label text)
Per Playwright: page.getByLabel('Username')
Sourcepub fn placeholder(text: impl Into<String>) -> Self
pub fn placeholder(text: impl Into<String>) -> Self
Create a placeholder selector (input/textarea by placeholder)
Per Playwright: page.getByPlaceholder('Enter email')
Sourcepub fn alt_text(text: impl Into<String>) -> Self
pub fn alt_text(text: impl Into<String>) -> Self
Create an alt text selector (images by alt attribute)
Per Playwright: page.getByAltText('Company Logo')
Sourcepub fn to_count_query(&self) -> String
pub fn to_count_query(&self) -> String
Convert to query for counting matches
Trait Implementations§
impl Eq for Selector
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
impl UnwindSafe for Selector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.