* Find an element with none of the provided CSS classes. * * Example: * locate('tr').withoutClass('deleted') * * @param {...string} classes * @returns {Locator}
(...classes)
| 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. |