Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 1 | declare namespace Cypress { |
| 2 | interface Chainable { |
| 3 | assertComponentInfoTitleLabelsAndValues: typeof assertComponentInfoTitleLabelsAndValues |
| 4 | } |
| 5 | } |
| 6 | |
| 7 | |
| 8 | |
| 9 | function assertComponentInfoTitleLabelsAndValues(expectedTitle: string, labelsAndValues: string[][]) : void{ |
| 10 | cy.getElementByDataTestsId('component-info-section-title').should('have.text', expectedTitle); |
| 11 | labelsAndValues.forEach((tuple: string[], index: number, array: string[][]) => { |
| 12 | let label = tuple[0]; |
| 13 | let value = tuple[1]; |
| 14 | cy.getElementByDataTestsId('model-item-label-' + label).should('have.text', label); |
| 15 | cy.getElementByDataTestsId('model-item-value-' + label).should('have.text', value); |
| 16 | }); |
| 17 | } |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | Cypress.Commands.add('assertComponentInfoTitleLabelsAndValues', assertComponentInfoTitleLabelsAndValues); |