* @param {Object. } attributes * @returns {Locator}
(attributes)
| 328 | * @returns {Locator} |
| 329 | */ |
| 330 | withAttr(attributes) { |
| 331 | const operands = [] |
| 332 | for (const attr of Object.keys(attributes)) { |
| 333 | operands.push(`@${attr} = ${xpathLocator.literal(attributes[attr])}`) |
| 334 | } |
| 335 | const xpath = sprintf('%s[%s]', this.toXPath(), operands.join(' and ')) |
| 336 | return new Locator({ xpath }) |
| 337 | } |
| 338 | |
| 339 | /** |
| 340 | * Adds condition: attribute value starts with text |
no test coverage detected