(locator)
| 554 | } |
| 555 | |
| 556 | _normalizeLocator(locator) { |
| 557 | if (typeof locator === 'string') { |
| 558 | return locator |
| 559 | } |
| 560 | |
| 561 | if (typeof locator === 'object') { |
| 562 | // Handle CodeceptJS locator objects |
| 563 | if (locator.css) return locator.css |
| 564 | if (locator.xpath) return locator.xpath |
| 565 | if (locator.id) return `#${locator.id}` |
| 566 | if (locator.name) return `[name="${locator.name}"]` |
| 567 | if (locator.className) return `.${locator.className}` |
| 568 | } |
| 569 | |
| 570 | return locator.toString() |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | export default WebElement |
no test coverage detected