MCPcopy
hub / github.com/codeceptjs/CodeceptJS / assertElementExists

Function assertElementExists

lib/helper/Playwright.js:4599–4605  ·  view source on GitHub ↗
(res, locator, prefix, suffix)

Source from the content-addressed store, hash-verified

4597}
4598
4599function assertElementExists(res, locator, prefix, suffix) {
4600 // if element text is an empty string, just exit this check
4601 if (typeof res === 'string' && res === '') return
4602 if (!res || res.length === 0) {
4603 throw new ElementNotFound(locator, prefix, suffix)
4604 }
4605}
4606
4607function assertOnlyOneElement(elements, locator, helper) {
4608 if (elements.length > 1) {

Callers 15

_withinBeginMethod · 0.70
moveCursorToMethod · 0.70
focusMethod · 0.70
blurMethod · 0.70
scrollToMethod · 0.70
_locateCheckableMethod · 0.70
seeElementMethod · 0.70
dontSeeElementMethod · 0.70
clickXYMethod · 0.70
fillFieldMethod · 0.70
clearFieldMethod · 0.70
appendFieldMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected