Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions thirtyfour-macros/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ fn is_multi_resolver(path: &syn::Path) -> bool {
}

/// All args for a single element resolver.
#[allow(clippy::large_enum_variant)]
enum SingleResolverOptions {
CustomFn(Expr),
Opts {
Expand Down Expand Up @@ -870,6 +871,7 @@ impl ToTokens for SingleResolverArgs {
}

/// All args for a multi-element resolver.
#[allow(clippy::large_enum_variant)]
enum MultiResolverOptions {
CustomFn(Expr),
Opts {
Expand Down
14 changes: 7 additions & 7 deletions thirtyfour-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ pub(crate) use bail;
///
/// Optional attributes available within `#[by(..)]` include:
/// - `single`: (default, single element only) Return `NoSuchElement` if the number of elements
/// found is != 1.
/// found is != 1.
/// - `first`: (single element only) Select the first element that matches the query.
/// By default, a query will return `NoSuchElement` if multiple elements match.
/// This default is designed to catch instances where a query is not specific enough.
/// By default, a query will return `NoSuchElement` if multiple elements match.
/// This default is designed to catch instances where a query is not specific enough.
/// - `not_empty`: (default, multi elements only) Return `NoSuchElement` if no elements were found.
/// - `allow_empty`: (multi elements only) Return an empty Vec if no elements were found.
/// By default a multi-element query will return `NoSuchElement` if no
/// elements were found.
/// By default a multi-element query will return `NoSuchElement` if no
/// elements were found.
/// - `description = "..."`: Set the element description to be displayed in `NoSuchElement` errors.
/// - `allow_errors`: Ignore errors such as stale elements while polling.
/// - `wait(timeout_ms = 10000, interval_ms=500)`: Override the default polling options.
/// - `nowait`: Turn off polling for this element query.
/// - `custom = "my_resolve_fn"`: Use the specified function to resolve the element or component.
/// **NOTE**: The `custom` attribute cannot be specified with any other
/// attribute.
/// **NOTE**: The `custom` attribute cannot be specified with any other
/// attribute.
///
/// See [`ElementQueryOptions`] for more details on how each option is used.
///
Expand Down
1 change: 1 addition & 0 deletions thirtyfour/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ debug_sync_quit = []
[dependencies]
async-trait = "0.1.83"
base64 = "0.22"
bytes = "1"
futures-util = { version = "0.3.31", default-features = false, features = ["alloc"] }
http = "1"
indexmap = "2"
Expand Down
7 changes: 3 additions & 4 deletions thirtyfour/src/extensions/query/element_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn get_selector_summary(selectors: &[ElementSelector]) -> String {
format!("[{}]", Criteria(selectors))
}

fn get_elements_description(len: Option<usize>, description: &str) -> Cow<str> {
fn get_elements_description(len: Option<usize>, description: &str) -> Cow<'_, str> {
let suffix = match len {
Some(1) => "element",
Some(_) => "elements",
Expand All @@ -55,7 +55,7 @@ fn no_such_element(selectors: &[ElementSelector], description: &str) -> WebDrive
}

/// Filter the specified elements using the specified filters.
pub async fn filter_elements<'a, I, P, Ref>(
pub async fn filter_elements<I, P, Ref>(
mut elements: Vec<WebElement>,
filters: I,
) -> WebDriverResult<Vec<WebElement>>
Expand Down Expand Up @@ -364,8 +364,7 @@ impl ElementQuery {
pub async fn first(&self) -> WebDriverResult<WebElement> {
self.first_opt().await?.ok_or_else(|| {
let desc: &str = self.options.description.as_deref().unwrap_or("");
let err = no_such_element(&self.selectors, desc);
err
no_such_element(&self.selectors, desc)
})
}

Expand Down
2 changes: 1 addition & 1 deletion thirtyfour/src/session/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub trait HttpClient: Send + Sync + 'static {
/// or couldn't prove its availability
/// this isn't a simple clone,
/// this new client needs to be able to run in a new runtime even if the old runtime has been destroyed

//
// needed for object safety
#[allow(clippy::new_ret_no_self)]
#[allow(clippy::wrong_self_convention)]
Expand Down
2 changes: 1 addition & 1 deletion thirtyfour/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub fn get_limiter() -> &'static Semaphore {
/// Locks the Firefox browser for exclusive use.
///
/// This ensures there is only ever one Firefox browser running at a time.
pub async fn lock_firefox<'a>(browser: &str) -> Option<SemaphorePermit<'static>> {
pub async fn lock_firefox(browser: &str) -> Option<SemaphorePermit<'static>> {
if browser == "firefox" {
Some(get_limiter().acquire().await.unwrap())
} else {
Expand Down
Loading