pub struct MockDriver {
pub current_url: String,
pub elements: Vec<ElementHandle>,
pub js_results: Vec<Value>,
pub screenshot_data: Option<Screenshot>,
pub call_history: Vec<String>,
}Expand description
Mock driver for unit testing
Fields§
§current_url: StringCurrent URL
elements: Vec<ElementHandle>Mock elements
js_results: Vec<Value>JS execution results
screenshot_data: Option<Screenshot>Screenshot data
call_history: Vec<String>Call history for verification
Implementations§
Source§impl MockDriver
impl MockDriver
Sourcepub fn add_element(&mut self, element: ElementHandle)
pub fn add_element(&mut self, element: ElementHandle)
Add a mock element
Sourcepub fn set_js_result(&mut self, result: Value)
pub fn set_js_result(&mut self, result: Value)
Set mock JS result
Sourcepub fn set_screenshot(&mut self, screenshot: Screenshot)
pub fn set_screenshot(&mut self, screenshot: Screenshot)
Set mock screenshot
Sourcepub fn was_called(&self, method: &str) -> bool
pub fn was_called(&self, method: &str) -> bool
Check if method was called
Trait Implementations§
Source§impl Debug for MockDriver
impl Debug for MockDriver
Source§impl Default for MockDriver
impl Default for MockDriver
Source§fn default() -> MockDriver
fn default() -> MockDriver
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockDriver
impl RefUnwindSafe for MockDriver
impl Send for MockDriver
impl Sync for MockDriver
impl Unpin for MockDriver
impl UnsafeUnpin for MockDriver
impl UnwindSafe for MockDriver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more