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

Method withoutAttr

lib/locator.js:430–437  ·  view source on GitHub ↗

* Find an element that does NOT have any of the provided attribute/value pairs. * @param {Object. } attributes * @returns {Locator}

(attributes)

Source from the content-addressed store, hash-verified

428 * @returns {Locator}
429 */
430 withoutAttr(attributes) {
431 const operands = []
432 for (const attr of Object.keys(attributes)) {
433 operands.push(`not(@${attr} = ${xpathLocator.literal(attributes[attr])})`)
434 }
435 const xpath = sprintf('%s[%s]', this.toXPath(), operands.join(' and '))
436 return new Locator({ xpath })
437 }
438
439 /**
440 * Find an element that has no direct child matching the provided locator.

Callers 1

locator_test.jsFile · 0.80

Calls 2

toXPathMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected