pub struct Browser { /* private fields */ }Expand description
The current test’s browser: see browser. Cheap to clone, and every
clone is the same browser.
Implementations§
Source§impl Browser
impl Browser
Sourcepub fn ws_endpoint(&self) -> &str
pub fn ws_endpoint(&self) -> &str
Returns the Chrome DevTools Protocol WebSocket endpoint
(for example, ws://127.0.0.1:53211/devtools/browser/…).
Sourcepub fn recording(&self) -> Option<&Path>
pub fn recording(&self) -> Option<&Path>
Returns the path where the HTML replay recording will be written when
the test ends, or None if recording is disabled.
Sourcepub fn url(&self, name: &str) -> Result<String, Error>
pub fn url(&self, name: &str) -> Result<String, Error>
Returns the URL for navigating to the named gateway or frontend inside the browser. Requests to this URL are routed to the test session.
Sourcepub fn step<F: Future>(
&self,
name: impl Into<String>,
statement: F,
) -> impl Future<Output = F::Output>
pub fn step<F: Future>( &self, name: impl Into<String>, statement: F, ) -> impl Future<Output = F::Output>
Runs statement as a named step in the test recording and
telemetry, tagged with the caller’s source location.
Browser actions (clicks, keystrokes, navigations) and the backend
requests they trigger while statement runs are grouped under this
step. If statement panics or is dropped before completing, the step is
recorded as failed. Step-reporting failures never fail the test.
browser.step("pay", page.find_element("button#pay").await?.click()).await?;Trait Implementations§
Auto Trait Implementations§
impl Forget for Browser
impl Freeze for Browser
impl Move for Browser
impl RefUnwindSafe for Browser
impl Send for Browser
impl Sync for Browser
impl Unpin for Browser
impl UnsafeUnpin for Browserwhere
*const ArcInner<BrowserInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<BrowserInner>>: UnsafeUnpin,
impl UnwindSafe for Browserwhere
Arc<BrowserInner>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request