Skip to main content

ActionExecutor

Trait ActionExecutor 

Source
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§

Source

fn click(&mut self, selector: &str) -> Result<(), ExecutorError>

Execute a click action.

Source

fn type_text(&mut self, selector: &str, text: &str) -> Result<(), ExecutorError>

Execute a type action.

Source

fn wait(&mut self, condition: &WaitCondition) -> Result<(), ExecutorError>

Execute a wait action.

Source

fn navigate(&mut self, url: &str) -> Result<(), ExecutorError>

Execute a navigation action.

Source

fn execute_script(&mut self, code: &str) -> Result<String, ExecutorError>

Execute a script action.

Source

fn screenshot(&mut self, name: &str) -> Result<(), ExecutorError>

Take a screenshot.

Source

fn element_exists(&self, selector: &str) -> Result<bool, ExecutorError>

Check if element exists.

Source

fn get_text(&self, selector: &str) -> Result<String, ExecutorError>

Get element text.

Source

fn get_attribute( &self, selector: &str, attribute: &str, ) -> Result<String, ExecutorError>

Get element attribute.

Source

fn get_url(&self) -> Result<String, ExecutorError>

Get current URL.

Source

fn evaluate(&self, expression: &str) -> Result<bool, ExecutorError>

Evaluate JavaScript expression.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§