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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Helpers for running reliable browser tests.
//!
//! [`run_browser_test`](crate::testing::run_browser_test) owns the
//! browser-session lifecycle around an async test
//! body. It always attempts [`WebDriver::quit`] after the body returns or
//! unwinds, so early `?` returns and panicking assertions do not accidentally
//! leave cleanup to the blocking `Drop` fallback.
//!
//! The session input is any future that produces a [`WebDriver`]. This keeps
//! the same helper useful for a local managed browser and for an external
//! Selenium or Grid session:
//!
//! ```no_run
//! use thirtyfour::{
//! prelude::*,
//! testing::{BrowserTestError, run_browser_test},
//! };
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), BrowserTestError> {
//! let mut caps = DesiredCapabilities::chrome();
//! caps.set_headless()?;
//!
//! run_browser_test(WebDriver::managed(caps), |driver| async move {
//! driver.goto("https://example.com").await?;
//! driver.query(By::Css("h1")).single().await?;
//! Ok(())
//! })
//! .await
//! # }
//! ```
//!
//! [`WebDriver`]: crate::WebDriver
//! [`WebDriver::quit`]: crate::WebDriver::quit
pub use ;
pub use ;