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

Method withoutClass

lib/locator.js:407–412  ·  view source on GitHub ↗

* Find an element with none of the provided CSS classes. * * Example: * locate('tr').withoutClass('deleted') * * @param {...string} classes * @returns {Locator}

(...classes)

Source from the content-addressed store, hash-verified

405 * @returns {Locator}
406 */
407 withoutClass(...classes) {
408 if (!classes.length) return this
409 const predicates = classes.map(c => `not(contains(concat(' ', normalize-space(@class), ' '), ' ${c} '))`)
410 const xpath = sprintf('%s[%s]', this.toXPath(), predicates.join(' and '))
411 return new Locator({ xpath })
412 }
413
414 /**
415 * Find an element that does NOT contain the provided text.

Callers 1

locator_test.jsFile · 0.80

Calls 1

toXPathMethod · 0.95

Tested by

no test coverage detected