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

Method withoutDescendant

lib/locator.js:458–461  ·  view source on GitHub ↗

* Find an element that has no descendant matching the provided locator. * * Example: * locate('button').withoutDescendant('svg') * * @param {CodeceptJS.LocatorOrString} locator * @returns {Locator}

(locator)

Source from the content-addressed store, hash-verified

456 * @returns {Locator}
457 */
458 withoutDescendant(locator) {
459 const xpath = sprintf('%s[not(./descendant::%s)]', this.toXPath(), convertToSubSelector(locator))
460 return new Locator({ xpath })
461 }
462
463 /**
464 * Append a raw XPath predicate. Escape hatch for expressions not covered by the DSL.

Callers 1

locator_test.jsFile · 0.80

Calls 2

toXPathMethod · 0.95
convertToSubSelectorFunction · 0.85

Tested by

no test coverage detected