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