pub trait ActionExecutor {
// Required methods
fn click(&mut self, selector: &str) -> Result<(), ExecutorError>;
fn type_text(
&mut self,
selector: &str,
text: &str,
) -> Result<(), ExecutorError>;
fn wait(&mut self, condition: &WaitCondition) -> Result<(), ExecutorError>;
fn navigate(&mut self, url: &str) -> Result<(), ExecutorError>;
fn execute_script(&mut self, code: &str) -> Result<String, ExecutorError>;
fn screenshot(&mut self, name: &str) -> Result<(), ExecutorError>;
fn element_exists(&self, selector: &str) -> Result<bool, ExecutorError>;
fn get_text(&self, selector: &str) -> Result<String, ExecutorError>;
fn get_attribute(
&self,
selector: &str,
attribute: &str,
) -> Result<String, ExecutorError>;
fn get_url(&self) -> Result<String, ExecutorError>;
fn evaluate(&self, expression: &str) -> Result<bool, ExecutorError>;
}Expand description
Trait for executing actions in a playbook. Implement this for your specific testing environment.
Required Methods§
Sourcefn type_text(&mut self, selector: &str, text: &str) -> Result<(), ExecutorError>
fn type_text(&mut self, selector: &str, text: &str) -> Result<(), ExecutorError>
Execute a type action.
Sourcefn wait(&mut self, condition: &WaitCondition) -> Result<(), ExecutorError>
fn wait(&mut self, condition: &WaitCondition) -> Result<(), ExecutorError>
Execute a wait action.
Execute a navigation action.
Sourcefn execute_script(&mut self, code: &str) -> Result<String, ExecutorError>
fn execute_script(&mut self, code: &str) -> Result<String, ExecutorError>
Execute a script action.
Sourcefn screenshot(&mut self, name: &str) -> Result<(), ExecutorError>
fn screenshot(&mut self, name: &str) -> Result<(), ExecutorError>
Take a screenshot.
Sourcefn element_exists(&self, selector: &str) -> Result<bool, ExecutorError>
fn element_exists(&self, selector: &str) -> Result<bool, ExecutorError>
Check if element exists.
Sourcefn get_attribute(
&self,
selector: &str,
attribute: &str,
) -> Result<String, ExecutorError>
fn get_attribute( &self, selector: &str, attribute: &str, ) -> Result<String, ExecutorError>
Get element attribute.
Sourcefn get_url(&self) -> Result<String, ExecutorError>
fn get_url(&self) -> Result<String, ExecutorError>
Get current URL.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".