1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use super::{execute::Execute, Command};
use crate::{error::RunnerErrorKind, webdriver::Webdriver};
pub struct RunScript {
script: String,
}
impl RunScript {
pub fn new(script: String) -> Self {
Self { script }
}
}
#[async_trait::async_trait]
impl<D: Webdriver> Command<D> for RunScript {
async fn run(&self, runner: &mut crate::runner::Runner<D>) -> Result<(), RunnerErrorKind> {
Execute::new(self.script.clone(), None).run(runner).await
}
}