Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 1 | declare namespace Cypress { |
| 2 | interface Chainable { |
| 3 | getTableRowByIndex : typeof getTableRowByIndex; |
| 4 | } |
| 5 | } |
| 6 | |
| 7 | /*************************************** |
| 8 | get table row by table id and index |
| 9 | *************************************/ |
| 10 | function getTableRowByIndex(id : string, index : number) : Chainable<JQuery<HTMLElement>> { |
| 11 | return cy.get('table#' + id + ' tbody tr').eq(index); |
| 12 | } |
| 13 | |
| 14 | Cypress.Commands.add('getTableRowByIndex', getTableRowByIndex); |
| 15 | |