pub struct Touchscreen { /* private fields */ }Expand description
Touchscreen provides touch input simulation via a single touch point.
Access via Page::touchscreen().
Implementations§
Source§impl Touchscreen
impl Touchscreen
Sourcepub async fn tap(&self, x: f64, y: f64) -> Result<()>
pub async fn tap(&self, x: f64, y: f64) -> Result<()>
Sends a single touch to the specified coordinates.
Dispatches a touchstart and touchend event sequence at the given
viewport coordinates. Requires a touch-enabled browser context
(has_touch: true in BrowserContextOptions).
§Arguments
x- X coordinate in CSS pixels (relative to viewport top-left)y- Y coordinate in CSS pixels (relative to viewport top-left)
§Errors
Returns error if the RPC call fails or the page has been closed.
See: https://playwright.dev/docs/api/class-touchscreen#touchscreen-tap
Trait Implementations§
Source§impl Clone for Touchscreen
impl Clone for Touchscreen
Source§fn clone(&self) -> Touchscreen
fn clone(&self) -> Touchscreen
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for Touchscreen
impl !RefUnwindSafe for Touchscreen
impl Send for Touchscreen
impl Sync for Touchscreen
impl Unpin for Touchscreen
impl UnsafeUnpin for Touchscreen
impl !UnwindSafe for Touchscreen
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