1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! iOS-specific features
use async_trait::async_trait;
use fantoccini::error::CmdError;
use http::Method;
use crate::{AppiumClientTrait, IOSClient};
use crate::commands::AppiumCommand;

/// Simulate device shake
#[async_trait]
pub trait ShakesDevice : AppiumClientTrait {
    /// Simulate shaking the device.
    async fn shake(&self) -> Result<(), CmdError> {
        self.issue_cmd(AppiumCommand::Custom(
            Method::POST,
            "appium/device/shake".to_string(),
            None
        )).await?;

        Ok(())
    }
}

impl ShakesDevice for IOSClient {}