diff --git a/CHANGELOG.md b/CHANGELOG.md index d4deb4e..3257800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ ## Unreleased +* Allow the generic "I click" action to click elements with a `role="button"` attribute + ## v0.10.1 (December 12, 2024) * Made the browser click/hover steps more resilient to DOM nodes detaching mid-action diff --git a/toolproof/src/definitions/browser/mod.rs b/toolproof/src/definitions/browser/mod.rs index 332cd47..976e8af 100644 --- a/toolproof/src/definitions/browser/mod.rs +++ b/toolproof/src/definitions/browser/mod.rs @@ -276,7 +276,13 @@ impl BrowserWindow { let el_xpath = |el: &str| { format!("//{el}[contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), '{text}')]") }; - let xpath = [el_xpath("a"), el_xpath("button"), el_xpath("input")].join(" | "); + let xpath = [ + el_xpath("a"), + el_xpath("button"), + el_xpath("input"), + el_xpath("*[@role='button']"), + ] + .join(" | "); loop { let elements = browser_specific::wait_for_chrome_xpath_selectors(