pub struct ClickBuilder<'l, 'a> { /* private fields */ }Expand description
Builder for click operations with configurable options.
Created via Locator::click.
§Example
// Simple click - await directly
page.locator("button").click().await.ok();
// Force click without waiting for actionability
page.locator("button").click().force(true).await.ok();
// Click without waiting for navigation
page.locator("a").click().no_wait_after(true).await.ok();Implementations§
Source§impl<'l, 'a> ClickBuilder<'l, 'a>
impl<'l, 'a> ClickBuilder<'l, 'a>
Sourcepub fn position(self, x: f64, y: f64) -> Self
pub fn position(self, x: f64, y: f64) -> Self
Set the position offset from the element’s top-left corner.
By default, clicks the center of the element.
Set the mouse button to use.
Sourcepub fn modifiers(self, modifiers: i32) -> Self
pub fn modifiers(self, modifiers: i32) -> Self
Set modifier keys to hold during the click.
Use the modifiers constants from viewpoint_cdp::protocol::input::modifiers.
Sourcepub fn force(self, force: bool) -> Self
pub fn force(self, force: bool) -> Self
Whether to bypass actionability checks.
When true, the click will be performed immediately without waiting
for the element to be visible, enabled, or stable.
Sourcepub fn no_wait_after(self, no_wait_after: bool) -> Self
pub fn no_wait_after(self, no_wait_after: bool) -> Self
Whether to skip waiting for navigation after the click.
By default, the click will wait for any triggered navigation to complete.
Set to true to return immediately after the click is performed.
§Example
use viewpoint_core::Page;
// Click a link but don't wait for navigation
page.locator("a").click().no_wait_after(true).await?;Sourcepub async fn send(self) -> Result<(), LocatorError>
pub async fn send(self) -> Result<(), LocatorError>
Execute the click operation.
Trait Implementations§
Source§impl<'l, 'a> Debug for ClickBuilder<'l, 'a>
impl<'l, 'a> Debug for ClickBuilder<'l, 'a>
Source§impl<'l> IntoFuture for ClickBuilder<'l, '_>
impl<'l> IntoFuture for ClickBuilder<'l, '_>
Source§type IntoFuture = Pin<Box<dyn Future<Output = <ClickBuilder<'l, '_> as IntoFuture>::Output> + Send + 'l>>
type IntoFuture = Pin<Box<dyn Future<Output = <ClickBuilder<'l, '_> as IntoFuture>::Output> + Send + 'l>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<'l, 'a> Freeze for ClickBuilder<'l, 'a>
impl<'l, 'a> !RefUnwindSafe for ClickBuilder<'l, 'a>
impl<'l, 'a> Send for ClickBuilder<'l, 'a>
impl<'l, 'a> Sync for ClickBuilder<'l, 'a>
impl<'l, 'a> Unpin for ClickBuilder<'l, 'a>
impl<'l, 'a> !UnwindSafe for ClickBuilder<'l, 'a>
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
Mutably borrows from an owned value. Read more