* Returns a cell matching the specified text content.
(opts: {text: string})
| 499 | * Returns a cell matching the specified text content. |
| 500 | */ |
| 501 | findCell(opts: {text: string}): HTMLElement { |
| 502 | let {text} = opts; |
| 503 | |
| 504 | let cell = within(this.getTable()).getByText(text); |
| 505 | if (cell) { |
| 506 | while (cell && !/gridcell|rowheader|columnheader/.test(cell.getAttribute('role') || '')) { |
| 507 | if (cell.parentElement) { |
| 508 | cell = cell.parentElement; |
| 509 | } else { |
| 510 | break; |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | return cell; |
| 516 | } |
| 517 | |
| 518 | /** |
| 519 | * Returns the table. |
no test coverage detected