You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: strict mode for all helpers + improved MultipleElementsFound error (#5491)
* feat: improve MultipleElementsFound error and add strict mode to all helpers
Add strict mode support to Puppeteer and WebDriver helpers (previously only
Playwright). When `strict: true`, single-element operations (click, fillField,
etc.) throw MultipleElementsFound if more than one element matches.
Refactor MultipleElementsFound to use WebElement[] with async fetchDetails()
that shows absolute XPath and minified outerHTML for each matched element.
Add toAbsoluteXPath() and toOuterHTML() to WebElement class. Auto-call
fetchDetails() in CLI error display.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: extract simplifyHtmlElement to lib/html.js and add toSimplifiedHTML to WebElement
Move HTML simplification logic (removeNonInteractiveElements + unwrap + truncate)
into a reusable simplifyHtmlElement() function in lib/html.js. Add toSimplifiedHTML()
method to WebElement that combines toOuterHTML() with simplifyHtmlElement().
MultipleElementsFound.fetchDetails() now uses webEl.toSimplifiedHTML() directly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: WebDriver strict mode - use Array.from for element collections and fix HTML unwrap regex
WebdriverIO $$ returns a special collection, not a plain array. Using
Array.from() before .map() ensures WebElement[] is a real array with .length.
Also fix simplifyHtmlElement regex to handle cases where <head> tag is absent
in the parse5 output.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: DavertMik <davert@testomat.io>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments