// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
use super::Command;
use crate::{
error::RunnerErrorKind,
webdriver::{Locator, Webdriver},
};
pub struct DoubleClick {
target: Locator,
}
impl DoubleClick {
pub fn new(target: Locator) -> Self {
Self { target }
}
}
#[async_trait::async_trait]
impl<D: Webdriver> Command<D> for DoubleClick {
async fn run(&self, runner: &mut crate::runner::Runner<D>) -> Result<(), RunnerErrorKind> {
runner
.get_webdriver()
.double_click(self.target.clone())
.await?;
Ok(())
}
}