(selector: string, textContent?: string, accept?: (result: string) => boolean, retryCount?: number)
| 265 | } |
| 266 | |
| 267 | async waitForTextContent(selector: string, textContent?: string, accept?: (result: string) => boolean, retryCount?: number): Promise<string> { |
| 268 | accept = accept || (result => textContent !== undefined ? textContent === result : !!result); |
| 269 | |
| 270 | return await this.poll( |
| 271 | () => this.driver.getElements(selector).then(els => els.length > 0 ? Promise.resolve(els[0].textContent) : Promise.reject(new Error('Element not found for textContent'))), |
| 272 | s => accept!(typeof s === 'string' ? s : ''), |
| 273 | `get text content '${selector}'`, |
| 274 | retryCount |
| 275 | ); |
| 276 | } |
| 277 | |
| 278 | async waitAndClick(selector: string, xoffset?: number, yoffset?: number, retryCount: number = 200): Promise<void> { |
| 279 | await this.poll(() => this.driver.click(selector, xoffset, yoffset), () => true, `click '${selector}'`, retryCount); |
no test coverage detected