pub struct Harness { /* private fields */ }Implementations§
Source§impl Harness
impl Harness
pub fn enable_trace(&mut self, enabled: bool)
pub fn take_trace_logs(&mut self) -> Vec<String>
Source§impl Harness
impl Harness
pub fn from_html(html: &str) -> Result<Self>
pub fn from_html_with_url(url: &str, html: &str) -> Result<Self>
pub fn from_html_with_local_storage( html: &str, initial_local_storage: &[(&str, &str)], ) -> Result<Self>
pub fn from_html_with_url_and_local_storage( url: &str, html: &str, initial_local_storage: &[(&str, &str)], ) -> Result<Self>
Source§impl Harness
impl Harness
pub fn assert_text(&self, selector: &str, expected: &str) -> Result<()>
pub fn assert_value(&self, selector: &str, expected: &str) -> Result<()>
pub fn assert_checked(&self, selector: &str, expected: bool) -> Result<()>
pub fn assert_exists(&self, selector: &str) -> Result<()>
pub fn dump_dom(&self, selector: &str) -> Result<String>
Source§impl Harness
impl Harness
pub fn now_ms(&self) -> i64
pub fn clear_timer(&mut self, timer_id: i64) -> bool
pub fn clear_all_timers(&mut self) -> usize
pub fn pending_timers(&self) -> Vec<PendingTimer>
pub fn advance_time(&mut self, delta_ms: i64) -> Result<()>
pub fn advance_time_to(&mut self, target_ms: i64) -> Result<()>
pub fn flush(&mut self) -> Result<()>
pub fn run_next_timer(&mut self) -> Result<bool>
pub fn run_next_due_timer(&mut self) -> Result<bool>
pub fn run_due_timers(&mut self) -> Result<usize>
Source§impl Harness
impl Harness
pub fn set_trace_stderr(&mut self, enabled: bool)
pub fn set_trace_events(&mut self, enabled: bool)
pub fn set_trace_timers(&mut self, enabled: bool)
pub fn set_trace_log_limit(&mut self, max_entries: usize) -> Result<()>
pub fn set_random_seed(&mut self, seed: u64)
pub fn set_fetch_mock(&mut self, url: &str, body: &str)
pub fn set_fetch_mock_response(&mut self, url: &str, status: i64, body: &str)
pub fn set_clipboard_text(&mut self, text: &str)
pub fn clipboard_text(&self) -> String
pub fn set_clipboard_read_error(&mut self, error: Option<&str>)
pub fn set_clipboard_write_error(&mut self, error: Option<&str>)
pub fn clear_clipboard_errors(&mut self)
pub fn set_location_mock_page(&mut self, url: &str, html: &str)
pub fn clear_location_mock_pages(&mut self)
pub fn take_downloads(&mut self) -> Vec<DownloadArtifact>
pub fn take_clipboard_writes(&mut self) -> Vec<ClipboardWriteArtifact>
pub fn location_reload_count(&self) -> usize
pub fn clear_fetch_mocks(&mut self)
pub fn take_fetch_calls(&mut self) -> Vec<String>
pub fn set_match_media_mock(&mut self, query: &str, matches: bool)
pub fn clear_match_media_mocks(&mut self)
pub fn set_default_match_media_matches(&mut self, matches: bool)
pub fn take_match_media_calls(&mut self) -> Vec<String>
pub fn enqueue_confirm_response(&mut self, accepted: bool)
pub fn set_default_confirm_response(&mut self, accepted: bool)
pub fn enqueue_prompt_response(&mut self, value: Option<&str>)
pub fn set_default_prompt_response(&mut self, value: Option<&str>)
pub fn take_alert_messages(&mut self) -> Vec<String>
pub fn take_print_call_count(&mut self) -> usize
pub fn set_timer_step_limit(&mut self, max_steps: usize) -> Result<()>
Source§impl Harness
impl Harness
pub fn type_text(&mut self, selector: &str, text: &str) -> Result<()>
pub fn set_select_value(&mut self, selector: &str, value: &str) -> Result<()>
pub fn set_input_files( &mut self, selector: &str, files: &[MockFile], ) -> Result<()>
pub fn set_checked(&mut self, selector: &str, checked: bool) -> Result<()>
pub fn click(&mut self, selector: &str) -> Result<()>
pub fn focus(&mut self, selector: &str) -> Result<()>
pub fn blur(&mut self, selector: &str) -> Result<()>
pub fn press_enter(&mut self, selector: &str) -> Result<()>
pub fn copy(&mut self, selector: &str) -> Result<()>
pub fn paste(&mut self, selector: &str) -> Result<()>
pub fn cut(&mut self, selector: &str) -> Result<()>
pub fn submit(&mut self, selector: &str) -> Result<()>
pub fn dispatch(&mut self, selector: &str, event: &str) -> Result<()>
pub fn dispatch_keyboard( &mut self, selector: &str, event: &str, init: KeyboardEventInit, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Harness
impl !RefUnwindSafe for Harness
impl !Send for Harness
impl !Sync for Harness
impl Unpin for Harness
impl UnsafeUnpin for Harness
impl !UnwindSafe for Harness
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