Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 1 | declare namespace Cypress { |
| 2 | interface Chainable { |
| 3 | drawingBoardPressAddButtonByElementName: typeof drawingBoardPressAddButtonByElementName, |
| 4 | drawingBoardNumberOfExistingElementsShouldContains: typeof drawingBoardNumberOfExistingElementsShouldContains |
| 5 | } |
| 6 | } |
| 7 | |
| 8 | function drawingBoardPressAddButtonByElementName(elementName : string) : Chainable<any> { |
| 9 | return cy.getElementByDataTestsId(elementName + '-add-btn'); |
| 10 | } |
| 11 | |
| 12 | function drawingBoardNumberOfExistingElementsShouldContains(expectedElements : number) : void { |
| 13 | cy.getElementByDataTestsId('numberButton').contains(expectedElements); |
| 14 | } |
| 15 | |
| 16 | Cypress.Commands.add('drawingBoardPressAddButtonByElementName', drawingBoardPressAddButtonByElementName); |
| 17 | Cypress.Commands.add('drawingBoardNumberOfExistingElementsShouldContains', drawingBoardNumberOfExistingElementsShouldContains); |