()
| 62 | } |
| 63 | |
| 64 | private async findTextarea(): Promise<WebdriverIO.Element | null> { |
| 65 | const selectors = [ |
| 66 | '.rich-text-input[contenteditable="true"]', |
| 67 | '.bitfun-chat-input__input-area [contenteditable="true"]', |
| 68 | '[contenteditable="true"]', |
| 69 | '[data-testid="chat-input-textarea"]', |
| 70 | '.chat-input textarea', |
| 71 | 'textarea[class*="chat"]', |
| 72 | ]; |
| 73 | |
| 74 | for (const selector of selectors) { |
| 75 | try { |
| 76 | const element = await $(selector); |
| 77 | const exists = await element.isExisting(); |
| 78 | if (exists) { |
| 79 | console.log(`[ChatInput] Found input element with selector: ${selector}`); |
| 80 | return element; |
| 81 | } |
| 82 | } catch (e) { |
| 83 | // Continue |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | console.log('[ChatInput] Input element not found with any selector'); |
| 88 | return null; |
| 89 | } |
| 90 | |
| 91 | async typeMessage(message: string): Promise<void> { |
| 92 | const input = await this.findTextarea(); |
no test coverage detected