* Get text content of the element * @returns {Promise } Element text content
()
| 47 | * @returns {Promise<string>} Element text content |
| 48 | */ |
| 49 | async getText() { |
| 50 | switch (this.helperType) { |
| 51 | case 'playwright': |
| 52 | return this.element.textContent() |
| 53 | case 'webdriver': |
| 54 | return this.element.getText() |
| 55 | case 'puppeteer': |
| 56 | return this.element.evaluate(el => el.textContent) |
| 57 | default: |
| 58 | throw new Error(`Unsupported helper type: ${this.helperType}`) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Get attribute value of the element |