MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / assertOnlyOneElement

Function assertOnlyOneElement

lib/helper/Playwright.js:4607–4612  ·  view source on GitHub ↗
(elements, locator, helper)

Source from the content-addressed store, hash-verified

4605}
4606
4607function assertOnlyOneElement(elements, locator, helper) {
4608 if (elements.length > 1) {
4609 const webElements = elements.map(el => new WebElement(el, helper))
4610 throw new MultipleElementsFound(locator, webElements)
4611 }
4612}
4613
4614function $XPath(element, selector) {
4615 const found = document.evaluate(selector, element || document.body, null, 5, null)

Callers 1

proceedClickFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected